Use Data::Dumper to see what the hash looks like:
If you use forcearray when parsing the XML:use Data::Dumper; print header('text/plain'); print Dumper($foo);
Then you can access the data in a structure like this (which is exactly what Dumper prints):$foo = XMLin($xml, forcearray => 1);
With loops like this:$foo = { 'INFO' => [ { 'lastchecked' => '20010506070758', 'content' => 'Rendered by the Newest Nodes XML Generator' +, 'site' => 'http://perlmonks.org', 'sitename' => 'Perl Monks' } ] };
if(defined @{$data->{'INFO'}}){ for my $when(@{$data->{'INFO'}}){ $lastcheck = $when->{'lastchecked'} } }
Super search around perlmonks a bit for more info.
In reply to Re: How do I parse values of a complex anonymous hash of hashes?
by epoptai
in thread How do I parse values of a complex anonymous hash of hashes?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |