my @a = map { chr } (33..126); # printable ASCII chars my $string; $string .= $a[rand(@a)] for 1..20;