Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: error : can't locate object method "getAttribute" via package XML::DOM::NodeList

by choroba (Cardinal)
on Sep 27, 2016 at 08:45 UTC ( [id://1172727]=note: print w/replies, xml ) Need Help??


in reply to error : can't locate object method "getAttribute" via package XML::DOM::NodeList

You can turn a node list into a Perl array by just dereferencing it as an array:
#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; use XML::DOM; my $parser = 'XML::DOM::Parser'->new; my $doc = $parser->parsefile(shift) or die $!; my $config = $doc->getElementsByTagName('config'); my $config_attr = $config->[0]->getAttribute('logdir'); say $config_attr;

Update: code simplified.

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1172727]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (7)
As of 2024-03-19 08:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found