M
Michael Yang
I need to add the my lib path into @INC:
When I give the absolute path to the @INC, it works fine:
use lib "/home/michael/mylib";
But it doesn't work when I passed mylib as a scalar variable:
my $libpath = "/home/michael/mylib";
use lib $libpath;
In this way, the script can't locate the package in "mylib" path.
I need to use this scalar variable instead of hard-coded absolute
path.
Is there any ways to do this?
Thanks!
When I give the absolute path to the @INC, it works fine:
use lib "/home/michael/mylib";
But it doesn't work when I passed mylib as a scalar variable:
my $libpath = "/home/michael/mylib";
use lib $libpath;
In this way, the script can't locate the package in "mylib" path.
I need to use this scalar variable instead of hard-coded absolute
path.
Is there any ways to do this?
Thanks!