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


in reply to Re: Finding max value from a unique tag from XML
in thread Finding max value from a unique tag from XML

That's more XPath wizardry than I'd normally manage. FWIW, here's the translation of the above to plain old XML::LibXML:

use 5.010; use XML::LibXML 1.70; my $xml = XML::LibXML->load_xml(location => "1.xml"); say $xml->findnodes(q{ //doc/str[@name="docuid" and not(text() < //doc/str[@name="docuid" +]/text())] });
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'