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

Re^2: can't call method on an undefined error in perl script

by veerubiji (Sexton)
on Nov 21, 2011 at 13:56 UTC ( #939200=note: print w/replies, xml ) Need Help??


in reply to Re: can't call method on an undefined error in perl script
in thread can't call method on an undefined error in perl script

Hi I you mean sepcnode is not assigned, I can't overcome this error still please help what I have to do in my script.

  • Comment on Re^2: can't call method on an undefined error in perl script

Replies are listed 'Best First'.
Re^3: can't call method on an undefined error in perl script
by MidLifeXis (Monsignor) on Nov 21, 2011 at 14:13 UTC

    Who knows? We don't have the data you are trying to process. My guess is that the xpath pattern being searched for is not found in the document you are trying to process.

    --MidLifeXis

Re^3: can't call method on an undefined error in perl script
by Jenda (Abbot) on Nov 21, 2011 at 18:04 UTC

    Who said anything about it being unassigned?!? It's undefined which means the findnodes() on line 11 returned an undef. The notoriously bad docs of XML::LibXML do not say anything about what's this method supposed to return if the XPath query doesn't match anything, but an undef is a quite way to return "nothing". Even though rereading the docs it seems it's supposed to return a XML::LibXML::NodeList object in scalar context no matter what.

    Jenda
    Enoch was right!
    Enjoy the last years of Rome.

      Well, my( $foo ) = ...findnodes is list context

        Ahh ... good catch. You're right.

        Jenda
        Enoch was right!
        Enjoy the last years of Rome.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://939200]
help
Chatterbox?
[LanX]: well, me was kidding!
[marto]: One of the main train stations is right across the road, so handy from that perspective, and there are some nice hotels in the area, but it's not great after dark, or sometimes during the day to be honest
[LanX]: not easy to find good and affordable venues ...
[marto]: hmm, there are several universities and colleges handy that I'd have thought would offer such services, given this is out of term time, I've no experience of paying for venues :)
[LanX]: OK ...
[LanX]: I have no idea how Mark scouted, giving that he lives in London ... but I think he mentioned his wife being Scottish
[marto]: ah, so this is payback :P
[LanX]: problem with booking venues is that you only know the number of participants a week in advance. ..
[marto]: I guess most cities have areas similar to this, I tend not to mind personally, but would not go out of my way to head down that way
[marto]: it'll probably be fine.

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (11)
As of 2017-12-14 15:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (396 votes). Check out past polls.

    Notices?