my(%order); @order{qw(a z b y c x)} = (0..5); for(sort { $order{substr($a,0,1)} <=> $order{substr($b,0,1)} } @list2) {...