print for sort{ substr( $a, 1 ) <=> substr( $b, 1 ) } qw[ A473 B659 C123 D222 E001 ];; E001 C123 D222 A473 B659