Closed p5pRT closed 20 years ago
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
On Fri\, 31 Mar 2000 13:11:28 +0200\, Jan Pazdziora wrote:
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 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.
Please try this patch.
Sarathy gsar@activestate.com
Migrated from rt.perl.org#2912 (status was 'resolved')
Searchable as RT2912$