=over
=item sort SUBNAME LIST
=item sort BLOCK LIST
=item sort LIST
In list context, this sorts the LIST and returns the sorted list value.
In scalar context, the behaviour of C is undefined.
If SUBNAME or BLOCK is omitted, Cs in standard string comparison
order. If SUBNAME is specified, it gives the name of a subroutine
that returns an integer less than, equal to, or greater than C,
depending on how the elements of the list are to be ordered. (The C >> and C operators are extremely useful in such routines.)
SUBNAME may be a scalar variable name (unsubscripted), in which case
the value provides the name of (or a reference to) the actual
subroutine to use. In place of a SUBNAME, you can provide a BLOCK as
an anonymous, in-line sort subroutine.
If the subroutine's prototype is C, the elements to be compared
are passed by reference in C, as for a normal subroutine. This is
slower than unprototyped subroutines, where the elements to be
compared are passed into the subroutine
as the package global variables $a and $b (see example below). Note that
in the latter case, it is usually counter-productive to declare $a and
$b as lexicals.
In either case, the subroutine may not be recursive. The values to be
compared are always passed by reference, so don't modify them.
You also cannot exit out of the sort block or subroutine using any of the
loop control operators described in L or with C.
When C