because push @INC is a runtime statement,
use lib is a compile time statement

meaning you'll be alerted if the dir doesnt exist, or something else goes wrong at the
moment you start your script, rather then it dying half way when not findin a file.


hth
Jos Boumans

Maxim Berlin wrote:

> Hello Jos,
>
> Wednesday, June 27, 2001, Jos Boumans <[EMAIL PROTECTED]> wrote:
>
> JB> Please use the the 'use lib' pragma, rather then fiddling with @INC
>
> JB> concider:
> JB> use lib (../foo);
>
> JB> rather than:
>
> JB> BEGIN: { push @INC, '../foo' }
>
> JB> perldoc lib for more info
>
> according to perldoc lib:
>
>            use lib LIST;
>
>        is almost the same as saying
>
>            BEGIN { unshift(@INC, LIST) }
>
>        For each directory in LIST (called $dir here) the lib mod-
>        ule also checks to see if a directory called $dir/$arch-
>        name/auto exists.  If so the $dir/$archname directory is
>        assumed to be a corresponding architecture specific direc-
>        tory and is added to @INC in front of $dir.
>
> for my configs, i don't need (and don't have) $dir/$archname/auto directories, so i
> still use
>
> >>   BEGIN { unshift(@INC,"/usr/local/etc"); }
>
> am i wrong?
>
> Best wishes,
>  Maxim                            mailto:[EMAIL PROTECTED]

Reply via email to