Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Can't call method on an undefined value

by andal (Hermit)
on Nov 16, 2011 at 08:37 UTC ( #938334=note: print w/replies, xml ) Need Help??


in reply to Can't call method on an undefined value

Check when the method is called. It might happen that you call it before the variable "$logger" is created in main. For example this might happen if you call it directly in the body of the module you "use". Here's example.

package MyModule; $main::logger->debug("This may fail"); sub func { $main::logger->debug("This is OK"); } 1;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://938334]
help
Chatterbox?
[Discipulus]: if you prepend 'good' to this mere part of the day you get a wish..as in good morning LanX
[LanX]: good
[LanX]: ;-p
[Eily]: good mere part of the day to you too
[karlgoethebier]: good #metoo

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (10)
As of 2018-02-20 10:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (269 votes). Check out past polls.

    Notices?