use lib '.';

Martin Gleeson martin at gleeson.com
Thu Oct 3 04:51:25 CDT 2002


At 10:45 AM +1000 3/10/02, Adam Clarke wrote:
>Jens Porup wrote:
>>Here's another question from some code I'm documenting:
>>
>>Isn't it redundant to say
>>use lib '.';
>>
>>Doesn't a Perl program automatically have access to programs
>>in the current directory?
>>
>Seems to. Maybe it's a version thing (or just plain redundant :)
>
>Cheers
>Adam

Hi Folks,

@INC comes from the environment variable PERLLIB, which has a default
value that is set when perl is compiled, so you may or may not have
'.' in it by default. It would depend on your sysadmin and whether or
not they simply hit 'enter' in response to the compile questions.
You can add to PERLLIB in your shell rc file if you want to automatically
include your own lib directory and/or '.'.

As an aside, having '.' in any search path is seen as a Bad Thing(tm)
from a security point of view. People have been caught out by someone's
own version of 'ls' that they've put in their home directory on a shared
machine. The same thing would apply to their own version of 'strict.pm',
for example. Let your imagination wander...

Cheers,
Marty.
-- 
Martin Gleeson
http://martin.gleeson.com/



More information about the Melbourne-pm mailing list