FAQ
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
.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupperl5-porters @
categoriesperl
postedJul 19, '01 at 4:36p
activeJul 19, '01 at 4:36p
posts1
users1
websiteperl.org

1 user in discussion

Mike Guy: 1 post

People

Translate

site design / logo © 2022 Grokbase