in reply to What's the best way to avoid name collisions when creating files?
You can always attach the random string at the end of a date-time string to get more human-friendly filenames.sub rndlc{local$"=''; "@{[map{chr(97+int rand 26)} 1 .. shift]}" }; my $filename = rndlc(10);
Of course there's no guarantee you won't get the same string twice, but the odds are 2610 against it...
($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
=~y~b-v~a-z~s; print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: What's the best way to avoid name collisions when creating files?
by DrHyde (Prior) on May 03, 2005 at 09:03 UTC |