Sort records in an array, sort first by the first field and then by the second field. Use a tilde as a field separator.
my @final_array = sort {
(split "~", $a)[0] cmp (split "~", $b)[0]
||
(split "~", $a)[1] cmp (split "~", $b)[1] } @formatted_sorted_array;
Wednesday, May 14, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment