Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.96k stars 555 forks source link

use lib change? #2600

Closed p5pRT closed 20 years ago

p5pRT commented 24 years ago

Migrated from rt.perl.org#4273 (status was 'resolved')

Searchable as RT4273$

p5pRT commented 24 years ago

From gnat@frii.com

I've had a couple of Perl programs break with the move to 5.6.0. The reason is that I had my own module directory (in /blah\, say) and to support multiple versions of Perl I said​:

  use lib "/blah/$]";

I would install each module in /blah/{5.00404\,5.00503}. In each of those versions of Perl\, the use lib line above would also add the i386-freebsd/ arch-specific directory.

In 5.6.0\, this no longer seems to be the case. Now I find I have to say​:

  use lib "/blah/$]/i386-freebsd";

as well. That seems to be a bug. It's only in lib.pm\, the -I option to Perl still looks in the arch-specific directory.

Here's how I can duplicate it​:

% mkdir /tmp/blah % mkdir /tmp/blah/i386-freebsd % perl -I/tmp/blah -le 'print "@​INC[0\,1]"' /tmp/blah/i386-freebsd /tmp/blah % perl -Mlib=/tmp/blah -le 'print @​INC[0\,1]"' /tmp/blah /usr/local/lib/perl5/5.6.0/i386-freebsd

I'm using 5.6.0 on FreeBSD.

I can remember some discussion of arch-specific directories in use lib\, but can't remember the outcome nor find a mention of it in the Changes file.

Nat

p5pRT commented 24 years ago

From @doughera88

On Sat\, 9 Sep 2000\, Nathan Torkington wrote​:

I've had a couple of Perl programs break with the move to 5.6.0. The reason is that I had my own module directory (in /blah\, say) and to support multiple versions of Perl I said​:

use lib "/blah/$]";

In 5.6.0\, this no longer seems to be the case. Now I find I have to say​:

use lib "/blah/$]/i386-freebsd";

as well. That seems to be a bug. It's only in lib.pm\, the -I option to Perl still looks in the arch-specific directory.

Could you check 5.7.0? I think that's been fixed.

p5pRT commented 24 years ago

From @ysth

In article \Pine\.SOL\.4\.10\.10009101004430\.5491\-100000@​maxwell\.phys\.lafayette\.edu\, Andy Dougherty \doughera@​lafayette\.edu wrote​:

On Sat\, 9 Sep 2000\, Nathan Torkington wrote​:

I've had a couple of Perl programs break with the move to 5.6.0. The reason is that I had my own module directory (in /blah\, say) and to support multiple versions of Perl I said​:

use lib "/blah/$]";

In 5.6.0\, this no longer seems to be the case. Now I find I have to say​:

use lib "/blah/$]/i386-freebsd";

as well. That seems to be a bug. It's only in lib.pm\, the -I option to Perl still looks in the arch-specific directory.

Could you check 5.7.0? I think that's been fixed.

Yes\, except that $] would be 5.007. Just a use lib '/blah' should include any of​: /blah\, /blah/i386-freebsd\, /blah/5.7.0\, or /blah/5.7.0/i386-freebsd that exist. If you asked Configure nicely\, it may also pick up /blah/5.00503 or so.

Two queries​:

/blah/i386-freebsd would only be included if it has an auto subdir. Is this necessary? Should /blah/5.7.0/i386-freebsd also only be added if there is an auto subdir?

And\, when going through the inc_version_list directories\, should $archname subdirs also be added?

Does anyone understand the intent here?

p5pRT commented 24 years ago

From @doughera88

On Sun\, 10 Sep 2000\, Yitzchak Scott-Thoennes wrote​:

Does anyone understand the intent here?

The intent is twofold​:

1. For the main perl distribution and extra modules installed under   sitelib (and vendorlib)​: To the maximum extent possible\, you should   be able to continue using old modules with the new perl without   having to reinstall all the old modules every time you upgrade.   perl understands the default directory structure of the sitelib   hierarchy.

2. For modules installed under other directories (e.g. private   modules installed under $HOME)​: If your private directory is   structured just like the default sitelib hierarchy\, then perl will   apply the exact same searching strategy there as well.   If your private directory is NOT structured just like sitelib\,   then perl will still employ the same searching strategy as it   does for sitelib\, but it may or may not actually do what you   hoped it would do.