in reply to Re^2: How to execute/call perl module on different path ?
in thread How to execute/call perl module on different path ?
use lib $extra is (roughly) equivalent to BEGIN { unshift @INC,$extra }, so perl searches for libraries in $extra first. Your code
BEGIN { push( @INC, "/data/script" ); }
makes perl search for libraries in extra last, and only if no matching libraries were found in the original @INC.
That's hardly the same, and while it "works" in this special case, it will probably break in other situations.
Alexander
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: How to execute/call perl module on different path ?
by thomas895 (Deacon) on Jun 06, 2012 at 22:04 UTC |