Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: XML::LibXML::NodeList get_node

by tobyink (Abbot)
on Apr 09, 2014 at 11:21 UTC ( #1081635=note: print w/ replies, xml ) Need Help??

in reply to XML::LibXML::NodeList get_node

get_node is implemented much like this:

sub get_node { my ($self, $pos) = @_; $self->[$pos - 1]; }

So $nodelist->get_node(0) is the same as $arrayref->[-1].

I wouldn't rely on it if I were you though. It's undocumented behaviour that is merely an accident of the internal implementation of XML::LibXML::NodeList, and could theoretically change in the future.

use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name

Comment on Re: XML::LibXML::NodeList get_node
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (17)
As of 2015-03-30 20:23 GMT
Find Nodes?
    Voting Booth?

    When putting a smiley right before a closing parenthesis, do you:

    Results (659 votes), past polls