%_=(); print sort { %_{ $a } ||= SortKey( $a ) <=> %_{ $b } ||= SortKey( $b ) } <>; sub SortKey { my @a=split /\t/, shift(); $a[1]; }