XML::Twig question
am 23.12.2007 20:25:11 von goldtechHi,
Trying this but only "aaa" outputs not "bbb". What's fix? I'm new to
XML and Perl - help appreciated.
xml file:
perl file:
#!/usr/bin/perl -w
use strict;
use XML::Twig;
my $twig= XML::Twig->new( twig_roots => {'/config/attrbs' =>
\&do_attrb});
$twig->parsefile( "xmlt1.xml");
$twig->purge();
sub do_attrb {
my($a1) = $_->find_nodes("attrb");
print $a1->text, "\n";
}
output:
aaa