my @chars = (a..z, A..Z, 0..9); my $glob = '{' . join(',', @chars) . '}'; $glob x= 10; while (my $string = glob $glob) { print $string, "\n"; }