The special variables $a and $b are also used to specify order. Here's a very simple example:
$ perl -E ' my @x = (23, 12, 45); say "Unsorted:"; say for @x; say "Ascending:"; say for sort { $a <=> $b } @x; say "Descending:"; say for sort { $b <=> $a } @x; ' Unsorted: 23 12 45 Ascending: 12 23 45 Descending: 45 23 12
How would you implement that in your hypothetical syntax?
— Ken
In reply to Re^4: Notation of sort function
by kcott
in thread Notation of sort function
by Alphaphi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |