Copyright © tutorialspoint.com
Syntax
Definition and UsageSorts LIST according to the subroutine SUBNAME or the anonymous subroutine specified by BLOCK. If no SUBNAME or BLOCK is specified, then it sorts according to normal alphabetical sequence. If BLOCK or SUBNAME is specified, then the subroutine should return an integer less than, greater than, or equal to zero, according to how the elements of the array are to be sorted. Return Value
ExampleTry out following example:
It will produce following result:
|
Copyright © tutorialspoint.com