Front page | perl.perl5.porters |
Postings from July 2001
[ID 20010719.001] Failed require leaves debris behind
From:
Mike Guy
Date:
July 19, 2001 09:36
Subject:
[ID 20010719.001] Failed require leaves debris behind
Message ID:
E15NGml-0005qc-00@draco.cus.cam.ac.uk
Under some circumstances, a failed require() leaves some state around
which causes a subsequent require to fail on the first line:
$ cat Bad.pm
BEGIN { eval 'use $v';
die "greeble\n";
};
$ perl -w
$SIG{__DIE__} = sub {
require strict;
};
require Bad;
__END__
syntax error at /home/mjtg/perl5.6.1/lib/strict.pm line 1, near "package strict"
Compilation failed in require at - line 2.
BEGIN failed--compilation aborted at Bad.pm line 3.
Compilation failed in require at - line 4.
$
Demonstrated with perl5.6.1, but happens with all Perl versions up to
bleadperl.
Mike Guy
$ perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
Platform:
osname=solaris, osvers=2.6, archname=sun4-solaris
uname=''
config_args='-dOes -Dusedevel -Dcc=/usr/local/bin/gcc -Dld=/usr/local/bin/gcc -Dcpprun=/usr/local/bin/gcc -E -Dcppstdin=/usr/local/bin/gcc -E -f confug.sh'
hint=previous, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
Compiler:
cc='/usr/local/bin/gcc', ccflags ='-I/usr/local/include -I/opt/local/include -DREG_INFTY=22786',
optimize='-O',
cppflags='-I/usr/local/include -I/opt/local/include -DREG_INFTY=22786'
ccversion='', gccversion='2.7.2.3', gccosandvers='solaris2.6'
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=4
alignbytes=8, usemymalloc=y, prototype=define
Linker and Libraries:
ld='/usr/local/bin/gcc', ldflags =' -L/usr/local/lib -L/opt/local/lib'
libpth=/usr/local/lib /opt/local/lib /lib /usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -ldl -lm -lc -lcrypt
perllibs=-lsocket -lnsl -ldl -lm -lc -lcrypt
libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags='-fpic', lddlflags='-G -L/usr/local/lib -L/opt/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under solaris
Compiled at Apr 11 2001 13:19:39
@INC:
/home/mjtg/perl5.6.1/lib
/home/mjtg/perl5.6.1/lib
/home/mjtg/perl5.6.1/lib
/home/mjtg/perl5.6.1/lib
.
-
[ID 20010719.001] Failed require leaves debris behind
by Mike Guy