my @list = qw(b1 a2 s3 s4 i5 s6 t7); my @tsil = sort {substr($a, 0, 1) ne substr($b, 0, 1)} @list;