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

You can't split it up completely,

Just a tiny bit more, mixing your "solution" with lidden's:

sub compare { my @A = split /:/, $a; my @B = split /:/, $b; $A[0] <=> $B[0]; } my @sorted = sort compare @table; print @sorted;

(Incidentally I also changed the first argument to split, since it must be a pattern - strings are automatically converted of course, but there's one special case, so...)

If it ain't clear like this... I don't know what could ever be!!