Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2017-03-01 20:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (429 votes). Check out past polls.