my @sorted = map { $_->[1] } # pick interesting data sort { $a->[0] <=> $b->[0] } # sort numerically on first field map { [ split /\|/, $_, 2 ] } # extract sortable field: $_->[0] is sortable, # $_->[1] is data ;