my @sorted = sort { substr($a,0,1) <=> substr($b,0,1) || $a <=> $b } @unsorted;
gives the order you requested. Or maybe you want
my @sorted = sort { substr($a,0,1) <=> substr($b,0,1) || length($a) <=> length($b) || $a <=> $b } @unsorted;
If 211 not skipped from the output you provided, I could tell you which one you want.
source share