Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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

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 lurking in the Monastery: (5)
As of 2016-10-01 21:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?






    Results (8 votes). Check out past polls.