my @list = (' ', qw(a c e h j k l n o p r s t u)); my @nums = qw(5 14 12 13 0 1 8 9 13 4 3 11 0 10 3 11 7 0 4 1 2 6 3 11); print join '', @list[@nums];