The main problem is that the sort function should be written in terms of $a and $b. What you have ought to work if you call the coderef in @f as, print sort { $f[0]->($a, $b) } @list; I don't understand why you are counting calls to the comparison function after you read the counter. Does the real code have another sub clotted on $count, or do you call mcc() again to read it?
After Compline,
Zaxo
In reply to Re: Closures and sort
by Zaxo
in thread Closures and sort
by traveler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |