in reply to Re: problem with variables
in thread problem with variables
(Update: not tested, sorry)use XML::Twig; my $xml = <DATA>; my $twig = new XML::Twig ( TwigHandlers => { 'volume' => sub { print "Volume: " . @_->text . "\n" }, 'issue' => sub { print "Issue: " . @_->text . "\n" }, 'year' => sub { print "Year: " . @_->text . "\n" }, } ); $twig->parse($xml); __DATA__ <data> <volume>4</volume> <issue>12</issue> <year>2003</year> </data>
|
|---|