Mailing List Archive

should PERL5LIB dirs be searched differently to the defaults?
Hi all,

I've noticed that when resolving libraries, perl5.000 uses a different
search technique for directories in PERL5LIB than it does for its built-in
library directory.

e.g. if PERL5LIB is /otherplace/perl5, and I try to autoload foo.so, perl
does:

stat ("/otherplace/perl5/auto/Foo", 0xceed0) = -1 ENOENT
stat ("/usr/local/lib/perl5/sun4-sunos/auto/Foo", 0xceed0) = 0

Isn't more consistent for it to search

/otherplace/perl5/sun4-sunos/auto/Foo
^^^^^^^^^^
instead of

/otherplace/perl5/auto/Foo

or is there a good reason for this?

As it stands, I need to set PERL5LIB to

/otherplace/perl5/sun4-sunos:/otherplace/perl5

for perl to find the libs as well as the .pm modules.

TIA,
Nick
Re: should PERL5LIB dirs be searched differently to the defaults? [ In reply to ]
> From: Nick Gianniotis <nico@lehman.com>
>
> Hi all,
>
> I've noticed that when resolving libraries, perl5.000 uses a different
> search technique for directories in PERL5LIB than it does for its built-in
> library directory.
>
> e.g. if PERL5LIB is /otherplace/perl5, and I try to autoload foo.so, perl
> does:
>
> stat ("/otherplace/perl5/auto/Foo", 0xceed0) = -1 ENOENT
> stat ("/usr/local/lib/perl5/sun4-sunos/auto/Foo", 0xceed0) = 0
>
> Isn't more consistent for it to search
>
> /otherplace/perl5/sun4-sunos/auto/Foo
> ^^^^^^^^^^
> instead of
>
> /otherplace/perl5/auto/Foo
>
> or is there a good reason for this?
>
You are responsible for putting architecture specific directories into
PERL5LIB if required.

> As it stands, I need to set PERL5LIB to
>
> /otherplace/perl5/sun4-sunos:/otherplace/perl5
>
> for perl to find the libs as well as the .pm modules.
>
That's right.

> TIA,
> Nick
>
Tim.