Front page | perl.perl5.porters |
Postings from March 2000
[ID 20000331.003] Sort subroutine single nonsingle value
Thread Next
From:
Jan Pazdziora
Date:
March 31, 2000 03:11
Subject:
[ID 20000331.003] Sort subroutine single nonsingle value
Message ID:
200003311111.NAA03930@theseus.fi.muni.cz
This is a bug report for perl from adelton@fi.muni.cz,
generated with the help of perlbug 1.28 running under perl v5.6.0.
-----------------------------------------------------------------
[Please enter your report here]
Please consider this simple script
sub czcmp
{ return 0; }
sub czsort
{ sort { czcmp($a, $b); } @_; } ## this is line 4
my @a = czsort(1, 2);
The script fails with
Sort subroutine didn't return single value at tst line 4.
which IMHO shouldn't -- I simply declare a block and call
a function there, but the sort somehow seems to catch that @_. If I call
it with just czsort(1), the error is not there.
Under 5.005_03 and previous, this code (taken from Cz::Sort module)
works fine. It's simple to workaround it but I still think it is
a bug, since nor perldelta nor perlfunc seem to suggest that this
use of sort is not allowed.
Yours,
Honza Pazdziora
adelton@fi.muni.cz
[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
category=core
severity=medium
---
Site configuration information for perl v5.6.0:
Configured by adelton at Fri Mar 24 18:05:50 MET 2000.
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
Platform:
osname=solaris, osvers=2.7, archname=sun4-solaris
uname='sunos theseus 5.7 generic sun4u sparc sunw,ultra-2 '
config_args=''
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=undef
use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef
Compiler:
cc='gcc', optimize='-O3', gccversion=egcs-2.91.66 19990314 (egcs-1.1.2 release)
cppflags='-fno-strict-aliasing'
ccflags ='-fno-strict-aliasing'
stdchar='char', d_stdstdio=define, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
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='gcc', ldflags =''
libpth=/lib /usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -ldl -lm -lc -lcrypt -lsec
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'
Locally applied patches:
---
@INC for perl v5.6.0:
/export/packages/perl-5.6.0/lib/5.6.0/sun4-solaris
/export/packages/perl-5.6.0/lib/5.6.0
/export/packages/perl-5.6.0/lib/site_perl/5.6.0/sun4-solaris
/export/packages/perl-5.6.0/lib/site_perl/5.6.0
/export/packages/perl-5.6.0/lib/site_perl
.
---
Environment for perl v5.6.0:
HOME=/home/adelton
LANG (unset)
LANGUAGE (unset)
LC_CTYPE=cs
LD_LIBRARY_PATH=/usr/lib:/usr/ucblib:/usr/openwin/lib:/packages/run/gcc-2.5.7/lib:/packages/run/links/lib
LOGDIR (unset)
PATH=/usr/bin:/usr/sbin:/usr/ccs/bin:/usr/openwin/bin:/packages/run/modules-2.0/bin:/export/packages/perl-5.6.0/bin:/packages/run/links/bin
PERL_BADLANG (unset)
SHELL=/bin/bash
Thread Next
-
[ID 20000331.003] Sort subroutine single nonsingle value
by Jan Pazdziora