From: Terrence Brannon Date: Tue, 17 Mar 2009 12:39:48 +0000 (-0400) Subject: optionally return tree X-Git-Tag: 5.200_001~34 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=63007e38f0bdac71e72ac6e7eb4c07169d2a2bf7;p=html-element-library.git optionally return tree --- diff --git a/lib/HTML/Element/Library.pm b/lib/HTML/Element/Library.pm index bc85c9d..4c2d879 100644 --- a/lib/HTML/Element/Library.pm +++ b/lib/HTML/Element/Library.pm @@ -34,7 +34,7 @@ our $VERSION = '3.53'; # https://rt.cpan.org/Ticket/Display.html?id=44105 sub HTML::Element::fillinform { - my ($tree, $hashref)=@_; + my ($tree, $hashref, $return_tree)=@_; (ref $hashref) eq 'HASH' or die 'hashref not supplied as argument' ; @@ -42,6 +42,12 @@ sub HTML::Element::fillinform { my $html = $tree->as_HTML; my $new_html = HTML::FillInForm->fill(\$html, $hashref); + if ($return_tree) { + HTML::TreeBuilder->new_from_content($new_html); + } else { + $new_html; + } + } sub HTML::Element::siblings {