I needed a temporary file, but I wanted it to have a random name so a) I'd be less likely to succeed the "exists" test and b) so I don't have to delete my temp file during debugging. After reading this node I came up with this:
for ($i = 1; $i <= 8; $i++) { $filename .= chr( int(rand 26) + 97 ); } open(TMPFILE, ">$filename.html");
The question is, is this a good method? Am I being wrong-headed in the first place? Any pointers would be appreciated. Thanks.
In reply to Generating Random Filenames by willyyam
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |