The main reason to use the ($$) prototype in a sort routine is the case where you may be defining the sort routine in one package, and then calling sort in another.... my $a = "whatever"; my $sort_sub = sub ($$) { $_[0] <=> $_[1] }; @arr2 = sort $sort_sub @arr1; ...
In reply to Re: my $a outside sort block incompatibility
by tilly
in thread my $a outside sort block incompatibility
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |