in reply to leaking into sort when sorting an empty set
and you get what you expect.use Data::Dumper; sub foo { return (); } warn Dumper(sort {$a <=> $b} foo('1000'));
Or try:
It looks like Perl thinks that foo is the sort function, and 1000 is what is being passed into the sort. Both those solutions disambiguate the situation.use Data::Dumper; sub foo { return (); } warn Dumper(sort(foo('1000')));
|
|---|