in reply to newbie question: can't use my own lib in crob job
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).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: newbie question: can't use my own lib in crob job
by iwanthome (Beadle) on Mar 30, 2004 at 02:47 UTC | |
by Anonymous Monk on Mar 30, 2004 at 04:19 UTC | |
by Anonymous Monk on Mar 30, 2004 at 08:11 UTC | |
by Anonymous Monk on Mar 30, 2004 at 08:25 UTC | |
by Anonymous Monk on Mar 30, 2004 at 08:57 UTC |