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

    That was it... I had my context wrong for the findnodes function:

    Old:

    my $status = $dom->findnodes("..."); my $msg = $dom->findnodes("..."); . . print $status->getFirstChild()->data, "\n"; print $msg->getFirstChild()->data, "\n";

    New:

    my ($status) = $dom->findnodes("..."); my ($msg) = $dom->findnodes("..."); . . print $status->getFirstChild()->nodeValue(), "\n"; print $msg->getFirstChild()->nodeValue(), "\n";

    Thanks, everyone, for all the help.

      I'm guessing

      ->getFirstChild()->nodeValue()

      could be replaced with

      ->textContent()