I
ivowel
dear perl experts:
assume main.pl uses module module.pm, and both sit in /home/users/dir/.
I know I can add directories to library paths, but I don't like to
hardcode such paths---especially, because I may later want to do "mv
/home/users/dir /home/users/dirnew" and still be able to execute from
another location call "$ perl /home/users/dirnew/main.pl" . my first
attempt was
(my $libd= $0) =~ s/(.*\/).*/$1/g;
use lib "$libd";
die "$0 $libd\n";
tells me about an empty compile time value. Is there a recommended way
to accomplish this?
sincerely,
/iaw
assume main.pl uses module module.pm, and both sit in /home/users/dir/.
I know I can add directories to library paths, but I don't like to
hardcode such paths---especially, because I may later want to do "mv
/home/users/dir /home/users/dirnew" and still be able to execute from
another location call "$ perl /home/users/dirnew/main.pl" . my first
attempt was
(my $libd= $0) =~ s/(.*\/).*/$1/g;
use lib "$libd";
die "$0 $libd\n";
tells me about an empty compile time value. Is there a recommended way
to accomplish this?
sincerely,
/iaw