in reply to Re: (z) Finding an XML element with XML::Simple
in thread (z) Finding an XML element with XML::Simple

Actually, you don't have to put it in an attribute - it works just as well from a child element as long as you haven't used forcearray on that element name. I'd recommend calling XMLin something like this:

my $config = XMLin($filename, keyattr => {picture => 'Name'}, forcearray => ['picture'] );

Then you could access the required value like this:

print $config->{pictures}->{picture}->{'test.jpg'}->{Mtime}, "\n";