sub revcmp { # note that for brevity sort() does not use the normal way # of passing variables to its callback, but sets # global variables $a and $b reverse($a) cmp reverse($b); } my @strange = sort \&revcmp @list;