in reply to Re: Help with attributes and XML::Simple
in thread Help with attributes and XML::Simple

If you've got a reasonably recent version of XML::LibXML, that can be made even simpler.

use XML::LibXML 1.94; use Data::Dumper; my %hash = XML::LibXML -> load_xml(location => 'mydata.xml') -> getElementsByTagName('Vendor') -> map(sub { $_->{vendorUniqueKey} => $_->{name} }); print Dumper \%hash;
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'