Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^3: sorting an array with mixed elements...

by lidden (Curate)
on Jun 09, 2007 at 23:51 UTC ( [id://620226] : note . print w/replies, xml ) Need Help??


in reply to Re^2: sorting an array with mixed elements...
in thread sorting an array with mixed elements...

print sort { (split ":", $a)[0] <=> (split ":", $b)[0] } @table;
Is the same as:
my @sorted = sort { my @A = split ':', $a; my @B = split ':', $b; $A[0] <=> $B[0]; } @table; print @sorted;