use List::Util qw(shuffle); my @arr = ('A'..'Z'); my $combo = join '', (shuffle(@arr))[0..1]; print "$combo\n";