in reply to How to parse a xml file using XML::DOM??

For large files, I usually use XML::LibXML::Reader, which is a pull parser.
#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; use XML::LibXML::Reader; my $file = shift; my $reader = 'XML::LibXML::Reader'->new(location => $file) or die "Cannot read $file.\n"; while ($reader->nextElement('signal')) { say $reader->getAttribute('id') if '3464' eq $reader->getAttribute('sigid'); }

Similarly, in XML::XSH2, a wrapper around XML::LibXML :

stream :N :f file.xml select signal[@sigid=3464] { echo @id }

($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,