Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2014-12-29 12:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (187 votes), past polls