http://www.perlmonks.org?node_id=553724


in reply to Re: Problem handling array from XML stream
in thread Problem handling array from XML stream

In the interests of TIMTOWTDI, I wrote up an XPath version of your script:
use XML::LibXML; my $xml = XML::LibXML->new->parse_file('example.xml'); for my $status ($xml->findnodes('//Status')) { print join( ':', $status->findvalue('parent::Program/@NAME'), $status->findvalue('StatusDesc'), $status->findvalue('StatusDate'), $status->findvalue('StatusEndDate') ), "\n"; }