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')));
In reply to Re: leaking into sort when sorting an empty set
by tilly
in thread leaking into sort when sorting an empty set
by cazz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |