I was bite by this:
#!/usr/bin/env perl
use strict;
use warnings;
my @stuff = sort returns_list('whatever');
print "stuff: [@stuff]\n";
@stuff = returns_list('again');
@stuff = sort @stuff;
print "stuff: [@stuff]\n";
sub returns_list {
return qw( howdy all of you );
}
__END__
poletti@PolettiX:tmp$/opt/perl-5.8.8/bin/perl bug.pl
stuff: [whatever]
stuff: [all howdy of you]
poletti@PolettiX:tmp$/opt/perl-5.10.0/bin/perl bug.pl
stuff: [whatever]
stuff: [all howdy of you]
which is regarded as (thanks dakkar):
$ perl -MO=Deparse sort_bug.pl
use warnings;
use strict 'refs';
my(@stuff) = (sort returns_list 'whatever');
print "stuff: [@stuff]\n";
@stuff = returns_list('again');
@stuff = sort @stuff;
print "stuff: [@stuff]\n";
sub returns_list {
use warnings;
use strict 'refs';
return 'howdy', 'all', 'of', 'you';
}
dakkar also reminded me that this was the only way to support what then became sort BLOCK LIST.
This is just sick.
It really is (Score:1)
I have complained about that before [perlmonks.org].