Borisz,
I started using XML:Twig. However facing a problem.
my $twig = XML::Twig->new(twig_handlers => {a'=> \&Test ); # Parse the file $twig->parsefile($XmlFile); # Handler sub routine sub Test { my ($parser, $element) = @_; # This prints element <a> along with its contents to some out +put file $element->print(\*OP); # However What I really want done over here is have element <a> a +long with its subelements and text be copied to another variable inst +ead of being printed on screen }

Problem: What I really want done over here is have element along with its subelements and text be copied to another variable instead of being printed on screen

Something like

$ElementA .= $element->print;

Pls advice. Thanks,


In reply to Re^2: XML processing by shreya
in thread XML processing by shreya

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":