in reply to How to Parse XML output?
There are many CPAN modules which can help you. For your first foray into simple XML parsing, I'd recommend XML::Simple. Despite being "simple", it still tends to do what I need most of the time.
use 5.014; use XML::Simple; my $xmls = XMLin($xml_string); say $_->{AttrValue} for grep { $_->{AttrName} eq 'ref_num' } @{$xmls->{Attributes}->{Attribute}};
$xmls is just an ordinary HASH ref; it's usually instructive to print it out with Data::Dump, Data::Dumper or similar:
use Data::Dump; dd $xmls;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to Parse XML output?
by powermonk (Initiate) on Mar 13, 2013 at 16:59 UTC | |
by powermonk (Initiate) on Mar 13, 2013 at 17:12 UTC |