develooper Front page | perl.perl5.porters | Postings from July 2001

[ID 20010719.001] Failed require leaves debris behind

Mike Guy
July 19, 2001 09:36
[ID 20010719.001] Failed require leaves debris behind
Message ID:
Under some circumstances, a failed require() leaves some state around
which causes a subsequent require to fail on the first line:

$ cat
BEGIN { eval 'use $v';
        die "greeble\n";
$ perl -w
$SIG{__DIE__} = sub {
require strict;
require Bad;
syntax error at /home/mjtg/perl5.6.1/lib/ line 1, near "package strict"
Compilation failed in require at - line 2.
BEGIN failed--compilation aborted at line 3.
Compilation failed in require at - line 4.

Demonstrated with perl5.6.1, but happens with all Perl versions up to

Mike Guy

$ perl -V
Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration:
    osname=solaris, osvers=2.6, archname=sun4-solaris
    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'
    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
    cc='/usr/local/bin/gcc', ccflags ='-I/usr/local/include -I/opt/local/include -DREG_INFTY=22786',
    cppflags='-I/usr/local/include -I/opt/local/include -DREG_INFTY=22786'
    ccversion='', gccversion='', 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/, 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
    . Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About