use warnings; use strict; use XML::Twig; my $twig = XML::Twig->new( twig_handlers => { town => \&town }, ); $twig->parsefile('datafile_towns.xml'); sub town { my ($twig, $town) = @_; if ($town->first_child('location')->first_child_text('mapx') > 300 +) { print $town->first_child('towndata')->first_child_text('townna +me'); print "\n"; } } __END__ sometown
Key points:
In reply to Re: TWIGging XML to CSV: what's wrong with my syntax?
by toolic
in thread TWIGging XML to CSV: what's wrong with my syntax?
by tinker
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |