in reply to sorta sorting fun
my @sorted = sort { substr($a, 1, 1) cmp substr($b, 1, 2) } @names; [download]
The others aren't much more complicated, you just have to enhance the comparison in the curly braces. Or, even better, do a Schwartzian Transform.