Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: sub that finds ancestor elements

by tobyink (Abbot)
on Sep 13, 2012 at 20:52 UTC ( #993575=note: print w/replies, xml ) Need Help??


in reply to Re: sub that finds ancestor elements
in thread sub that finds ancestor elements

Why the colons between the module name and version number? (I doubt you need to specify the version number at all - ppm presumably defaults to the latest version available.)
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Replies are listed 'Best First'.
Re^3: sub that finds ancestor elements
by jccunning (Acolyte) on Sep 13, 2012 at 21:47 UTC
    When I install using "ppm install XML-LibXML" then version 1.70 of XML-LibXML is installed as the latest. Your script indicated "use XML::LibXML 2;". Of course, I get error that version 2 is required.

      Replace this:

      $node->findnodes("ancestor::*")->map(sub { $coolNodeName->($_) })

      With this:

      (map { $coolNodeName->($_) } $node->findnodes("ancestor::*"))

      ... and you should be able to use XML::LibXML 1.70.

      perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://993575]
help
Chatterbox?
Discipulus fears to ears this in German..
[LanX]: missing for month
[LanX]: D : Oberbefehlshaber
[GotToBTru]: yeah, thats the story I remember. some card the President is supposed to carry around at all times
[GotToBTru]: I suppose the actual details about what is necessary to actually do something is kept fuzzy deliberately
[LanX]: the interview was with the guy who designed the process
[LanX]: in the 70s
[GotToBTru]: so the font on the card is probably NOT Comic Sans
[GotToBTru]: that's a relief

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2017-01-20 12:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (174 votes). Check out past polls.