- or download this
sub rndStr{ join'', @_[ map{ rand @_ } 1 .. shift ] }
- or download this
sub rndStr{
my( $n, @chars ) = @_;
return join'', @chars[ map{ int rand @chars } 1 .. $n ];
}
- or download this
local $/;
my @chars = map chr, 0 .. 255;;
print rndStr 1024, @chars for 1 .. 2**20;;