in reply to sort by a multiple columns

#! perl -slw use strict; my @un_sorted = ([3,4,23,4,5],[3,4,56,2,4],[2,3,43,5,3],[2,3,43,6], [3 +,4] ); print join "\n", map{ join ',', @$_ } sort { for( 0 .. ( $#{$a} < $#{$b} ? $#{$b} : $#{$a} ) ) { return ( defined( $a->[ $_ ] ) ? $a->[ $_ ] : 1e308 ) <=> ( defined( $b->[ $_ ] ) ? $b->[ $_ ] : 1e308 ) || next; } return 0; } @un_sorted; __END__ P:\test>junk 2,3,43,5,3 2,3,43,6 3,4,23,4,5 3,4,56,2,4 3,4

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon