@g = qw(St1 St10 St2 St12 St6 St8);; print for map{ substr $_, 4 } sort map{ pack 'NA*', m[(\d+)], $_ } @g;; St1 St2 St6 St8 St10 St12