in reply to use lib './' security safe?
hbo@owen|1347> perl -e 'print join "\n",@INC' /usr/lib/perl5/5.8.1/i686-linux /usr/lib/perl5/5.8.1 /usr/lib/perl5/site_perl/5.8.1/i686-linux /usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl
Since use et al take the first match, there shouldn't be a danger of loading a bogus standard module if you have "."at the end of @INC. It's similar to having "./" at the end of your Unix PATH, however, in that what "./" means changes with your CWD. This opens up a possibility of loading a non-standard module that you don't expect. If you have root, (or administrator for *ix challenged) it's good practise to install your modules in the site_perl directories.
For my personal software, I create and use a ~/lib/perl and include the following at the top of my scripts:
That way I avoid the pesky relative path.use lib /path/to/my/home/lib/perl;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: use lib './' security safe?
by beable (Friar) on Jul 20, 2004 at 04:09 UTC | |
by hbo (Monk) on Jul 20, 2004 at 04:43 UTC |