Front page | perl.perl5.porters |
Postings from March 2000
[ID 20000321.082] wantarray fails in END block
Thread Next
From:
khw
Date:
March 21, 2000 16:54
Subject:
[ID 20000321.082] wantarray fails in END block
Message ID:
200003220053.RAA21992@drgpaxon
This is a bug report for perl from khwilliamson@lucent.com,
generated with the help of perlbug 1.26 running under perl 5.00503.
-----------------------------------------------------------------
# wantarray in the END block returns true in void context instead
of the proper 'undefined'. This program illustrates:
use strict;
sub fails($)
{
my $string = shift;
print $string, ", not void context\n" if defined wantarray;
print $string, ", in void context\n" unless defined wantarray;
}
fails("not in END"); # void context
END {
fails("in END"); # void context
}
# both calls to 'fails' should print the same result, but they don't
# on my system. And by the way, the O'Reilly "Programming Perl" p. 241
# 2nd edition fails to mention wantarray being undefined in void context
# It's in perlpod perlfunc.
-----------------------------------------------------------------
---
Site configuration information for perl 5.00503:
Configured by expmake at Fri Sep 10 16:33:51 CDT 1999.
Summary of my perl5 (5.0 patchlevel 5 subversion 3) configuration:
Platform:
osname=solaris, osvers=2.4, archname=sun4-solaris
uname='sunos nwpep 5.4 generic_101945-61 sun4d sparc '
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef useperlio=undef d_sfio=undef
Compiler:
cc='cc', optimize='-O', gccversion=
cppflags=''
ccflags =''
stdchar='unsigned char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
alignbytes=8, usemymalloc=y, prototype=define
Linker and Libraries:
ld='cc', ldflags =''
libpth=/lib /usr/lib /usr/ccs/lib
libs=-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='-KPIC', lddlflags='-G'
Locally applied patches:
---
@INC for perl 5.00503:
/opt/exp/perl/lib/5.00503/sun4-solaris
/opt/exp/perl/lib/5.00503
/opt/exp/perl/lib/site_perl/5.005/sun4-solaris
/opt/exp/perl/lib/site_perl/5.005
.
---
Environment for perl 5.00503:
HOME=/home/khw
LANG (unset)
LANGUAGE (unset)
LD_LIBRARY_PATH=/usr/openwin/lib:/usr/lib
LOGDIR (unset)
PATH=/usr/local/src/post/src/post:/home/khw/specbin:/home/khw/bin:/home/khw/print/bin:/usr/add-on/dwb/bin:/usr/5bin:/usr/ucb:/usr/add-on/local/bin:/usr/add-on/unison/bin:/opt/exp/bin:/usr/sbin:/usr/add-on/zmail/bin:/usr/add-on/ncmp/630/bin:/usr/add-on/SUNWspro/bin:/usr/openwin/bin:/usr/openwin/demo:/usr/bin/X11:/usr/add-on/ncmp/bin:/usr/ccs/bin:/etc:/usr/add-on/defty5/bin:/usr/add-on/tools/bin:/opt/exp/perl/bin:
PERL_BADLANG (unset)
SHELL=/bin/ksh
Thread Next
-
[ID 20000321.082] wantarray fails in END block
by khw