Or give XML::Twig a try:
See also xmltwig.org#!/usr/bin/perl + use strict; use warnings; use XML::Twig; my $file = shift; my $twig = XML::Twig->new( twig_handlers => { inventor => \&inventor } + ); $twig->parsefile($file); sub inventor { my ( $twig, $inventor ) = @_; if ( $inventor->first_child('number')->text eq "1" ) { print $inventor->first_child('country')->text . qq(\n) . $inventor->first_child('city')->text . qq(\n) . $inventor->first_child('upper-name')->text . qq(\n) . $inventor->first_child('name')->text . qq(\n); } } __END__
Regards, Karl
«The Crux of the Biscuit is the Apostrophe»
In reply to Re: XML::Simple parsing help
by karlgoethebier
in thread XML::Simple parsing help
by jhoop
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |