Thank you. The two together correctly calculate the script's path dynamically.
For future reference for anyone who may need it, the entire section of code I'm using to determine the location of lib, where I have a directory structure like 'client/project/*' (where I have bin, cgi and lib at the * level and want my local lib first is:
BEGIN {
use Cwd qw/abs_path/;
use File::Spec::Functions qw/rel2abs/;
my $path = rel2abs(abs_path($0));
if ($path =~ m,^((?:/\w+)*?/)(?:cgi|bin)/,) {
unshift @INC, $1.'lib';
} else {
die "Unable to determine lib path from $path";
}
};
|