sortsort [ code ] list
Sorts a
list
and returns the sorted
list value. By default (without a
code
argument),
it sorts in standard string comparison order (undefined
values sorting before defined null strings, which sort before everything else).
code
, if given, may be the name of a subroutine or a code block
(anonymous subroutine) that defines its own comparison mechanism for sorting
elements of
list
. The routine must return to the
The normal calling
code for subroutines is bypassed, with the following effects: the subroutine may
not be a recursive subroutine, and the two elements to be compared are passed
into the subroutine as
Do not declare
In versions preceding 5.005,
Perl's Copyright © 2001 O'Reilly & Associates. All rights reserved. |
|