in reply to Re^2: Missing Node.PM in XML::LibXML v1.69
in thread Missing Node.PM in XML::LibXML v1.69
XML::LibXML::NodeList isn't XML::LibXML::Node.
You are probably using findnodes in scalar context.
my @nodes = $doc->findnodes(...); # Return all matching nodes my $nodes = $doc->findnodes(...); # Ditto, as a NodeList
If you want the first match node, call findnodes in list context.
my ($node) = $doc->findnodes(...); # Get first matching node.
If you want to visit every matching node, the following is probably more what you want:
for my $node ($doc->findnodes(...)) { ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Missing Node.PM in XML::LibXML v1.69
by BluePerlDev (Novice) on Jun 14, 2010 at 14:53 UTC | |
by ikegami (Patriarch) on Jun 14, 2010 at 17:19 UTC |