I'd have to do some research to figure out how Perl handles a "BEGIN" block in relation to "use" for loading modules. (Others here presumably know this by heart and can point to relevant nodes at the monastery). But based on the evidence in your post, I'd say that it's trying to run your BEGIN block before it has loaded File::Basename. (Maybe putting "require File::Basename;" inside the BEGIN block would solve the problem too.)use File::Basename; my $cwd = dirname $0; my $libpath = $cwd."/lib"; require "$libpath/My/Ownmodule.pm";
In any case, the approach shown above would avoid the issue, by using "require" to load your personal module from the intended path, and this is a run-time operation as opposed to a compile-time issue (or something to that effect).
In reply to Re: newbie question: can't use my own lib in crob job
by graff
in thread newbie question: can't use my own lib in crob job
by iwanthome
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |