in reply to TWIGging XML to CSV: what's wrong with my syntax?
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:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: TWIGging XML to CSV: what's wrong with my syntax?
by tinker (Initiate) on Apr 11, 2015 at 01:32 UTC |