my @Chars = ( "A" .. "Z", "a" .. "z", 0 .. 9); my $RandString = join("", @Chars[ map { rand @Chars } ( 1 .. 30 ) ]);