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;
In reply to Re: Can't call method on an undefined value
by andal
in thread Can't call method on an undefined value
by Zettai
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |