This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make sort {} and sort {()} equivalent
authorFather Chrysostomos <sprout@cpan.org>
Mon, 21 Nov 2011 00:50:37 +0000 (16:50 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 21 Nov 2011 08:32:31 +0000 (00:32 -0800)
commit1715fa648339558035d9920399c9f04263c0a14e
treed205c722d8f26af9475ef8ce307956154f93fac0
parentcfe287a06b2ed98c25aebb477f6b400409f1fc85
Make sort {} and sort {()} equivalent

sub {} and sub{()} are equivalent.  In list context they both return
the empty list.  In scalar context they both return undef.  But sort
doesn’t seem to think so.  It croaks on sub{}.  This commit fixes that
and makes it consistent.

I left XSUBs alone, since I’m not sure how they are supposed
to behave.
pp_sort.c
t/lib/warnings/9uninit