push @foo, [ split /:/ ] while <>; print map { "$_->[0]\n" } sort { $a->[2] <=> $b->[2] } @foo; # Two lines, for clarity. # Of course I could have used another map. #### 2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$