in reply to Parsing xml
Don't use XML::Simple. Its documentation itself tells you you shouldn't.
You can use XML::LibXML instead.
#!/usr/bin/perl use warnings; use strict; use XML::LibXML; my $xml = 'XML::LibXML'->load_xml(location => shift); for my $username ($xml->findnodes('//username')) { print $username->textContent, "\n"; }
I usually use XML::XSH2, which is a wrapper around XML::LibXML. It simplifies the above code to
open file.xml ; for //username echo (.) ;
($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parsing xml
by alexsc01 (Novice) on Feb 19, 2016 at 11:55 UTC |