in reply to adding library directories relative to $0
I do the same thing in certain scripts, so would be curious if someone suggested another solution.
Also, I use __FILE__ instead, to ensure that it's relative to the current file instead of the executing script.
# use lib <Relative Directory> use lib; use Cwd qw(abs_path); use File::Basename qw(dirname); BEGIN { my $dirname = dirname(__FILE__); my $perl = abs_path("$dirname/../../perl"); lib->import($perl); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: adding library directories relative to $0
by ikegami (Patriarch) on Feb 22, 2011 at 22:15 UTC | |
by roboticus (Chancellor) on Feb 23, 2011 at 00:18 UTC | |
by ikegami (Patriarch) on Feb 23, 2011 at 01:29 UTC | |
by wind (Priest) on Feb 23, 2011 at 18:57 UTC | |
by roboticus (Chancellor) on Feb 23, 2011 at 10:29 UTC |