Closed p5pRT closed 21 years ago
The pod documentation in lib.pm says that:
use lib "dir" is supposed to also put dir/\
no lib "dir" is supposed to remove dir and dir/\
The actual code behavior is different:
import() [code for "use lib"] looks for dir/\
unimport() [code "no lib"] works as documented\, i.e.\, removes dir/\
Suggested fix (patch attached):
1. Make import() set up @INC to contain the following dirs if the exist:
dir/\
2. Remove the remaining checks for /auto subdir from unimport()
3. Make unimport() remove the same 4 directories from @INC\, without checking to see if any exist on the system.
4. Fix the pod text.
Here is a patch which I think does that:
Flags: category=library severity=medium
Site configuration information for perl v5.6.0:
Configured by root at Mon Jun 18 09:01:54 GMT 2001.
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration: Platform: osname=linux\, osvers=2.4.3\, archname=i586-linux uname='linux armstrong 2.4.3 #1 wed may 16 00:37:55 gmt 2001 i686 unknown ' config_args='-ds -e -Dprefix=/usr -Di_db -Di_dbm -Di_ndbm -Di_gdbm' hint=recommended\, useposix=true\, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef Compiler: cc='cc'\, optimize='-O2 -pipe'\, gccversion=2.95.3 20010315 (SuSE) cppflags='-fno-strict-aliasing -I/usr/local/include' ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' stdchar='char'\, d_stdstdio=define\, usevfork=false intsize=4\, longsize=4\, ptrsize=4\, doublesize=8 d_longlong=define\, longlongsize=8\, d_longdbl=define\, longdblsize=12 ivtype='long'\, ivsize=4\, nvtype='double'\, nvsize=8\, Off_t='off_t'\, lseeksize=8 alignbytes=4\, usemymalloc=n\, prototype=define Linker and Libraries: ld='cc'\, ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -ldl -lm -lc -lcrypt libc=\, so=so\, useshrplib=false\, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs\, dlext=so\, d_dlsymun=undef\, ccdlflags='-rdynamic' cccdlflags='-fpic'\, lddlflags='-shared -L/usr/local/lib'
Locally applied patches:
@INC for perl v5.6.0: /usr/lib/perl5/5.6.0/i586-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i586-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .
Environment for perl v5.6.0: HOME=/home/jima LANG=en_US LANGUAGE (unset) LC_COLLATE=POSIX LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/home/jima/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/lib/java/bin:/var/lib/dosemu:/usr/games/bin:/usr/games:/opt/bin:/opt/gnome/bin:/opt/kde2/bin:/opt/kde/bin:/usr/openwin/bin:.:/opt/pilotsdk/bin:/opt/jima/bin:/usr/sbin:/sbin PERL_BADLANG (unset) SHELL=/bin/bash
Moin\,
you wrote:
use lib "dir" is supposed to also put dir/\
into @INC if dir/\ /auto exists. no lib "dir" is supposed to remove dir and dir/\
from @INC if the directory dir/\ /auto exists on the system. The actual code behavior is different:
import() [code for "use lib"] looks for dir/\
and dir/\ /\ where \ is either the current perl version or from Config{inc_version_list}\, and does not care whether there is an auto subdirectory. unimport() [code "no lib"] works as documented\, i.e.\, removes dir/\
from @INC if dir/\ /auto exists in the system\, but it does not look for any of the directories inserted by import(). Suggested fix (patch attached):
1. Make import() set up @INC to contain the following dirs if the exist:
dir/\<version>/\<archname> \(first in @​INC\) dir/\<any of inc\_version\_list>/\<archname> dir/\<archname> dir/\<version> dir/\<any of inc\_version\_list> dir
Iif I read this correctly\,
use lib 'lib';
would put 'lib' at the 6th place into @INC\, but the
dir/\
lib/Math/BigInt.pm # v1.47 test.pl
and test.pl is:
use lib 'lib'; use Math::BigInt;
print $Math::BigInt::VERSION\,"\n";
will print whatever version is installed of Math::BigInt\, not the one that isin lib/Math/. This will break things greatly (or read: a lot of my scripts) and generally be a pain in the lower uhm regions\, because then you would have no longer a way to pick up the local libraries first (that is\, without doing unshift 'lib'\, @INC; which use lib 'lib' was to avoid in the first place - or so I thought.)
Uhm? Do I miss something?
Cheers\,
Tels
- -- perl -MDev::Bollocks -e'print Dev::Bollocks->rand()\,"\n"' administratively grow enterprise infrastructures
http://bloodgate.com/perl My current Perl projects PGP key available on http://bloodgate.com/tels.asc or via email
-----BEGIN PGP SIGNATURE----- Version: 2.6.3i Charset: latin1
iQEVAwUBO/9iQHcLPEOTuEwVAQFCjwf+NOCNFhjYmkx/GrhZpvf4YI6nGLggOCvH upmWs+J5MyFzccQLQvtDn8U224u1j7tUcK4y5x/2/dZGgUj25nzDwDUa3T88MCU6 xx5ht5FeFjQilWhS66+30po2WSLh6KOlzPcD+hAaPC5Thi/t5SX5DqnFPtwCAaYW VGnCdDGjE1eFNQldvx8pn8yCFR2eMJYTnumZJn8Ei1Ijwe0bSkW9tMPpgoHhv7Fi uCB+PQU16kRYYZxa1EO72hh8yGd2z0vAjUt8fe6QftQSH3bHgGypvGnkbIUdR1Ec UfVuBta4uphNm5JJihs3CEz1Z2e2pat715foqnzvkJA2Wd2s05KUSw== =VQTY -----END PGP SIGNATURE-----
This is a bug report for perl from james_avera@yahoo.com\, generated with the help of perlbug 1.28 running under perl v5.6.0.
The pod documentation in lib.pm says that:
use lib "dir" is supposed to also put dir/\
into @INC if dir/\ /auto exists. no lib "dir" is supposed to remove dir and dir/\
from @INC if the directory dir/\ /auto exists on the system. The actual code behavior is different:
This was fixed in perl-5.6.1\, which was released in April\, 2001. Could you please check if the version included in perl-5.6.1 does what you need it to do? (Also note that 5.6.1 correctly updated perl.c to do the same auto-searching for -I directives.)
Thanks\,
Andy Dougherty doughera@lafayette.edu Dept. of Physics Lafayette College\, Easton PA 18042
@doughera88 - Status changed from 'open' to 'resolved'
Migrated from rt.perl.org#7931 (status was 'resolved')
Searchable as RT7931$