I like the idea by
setebos of using
gettimeofday for high-granularity time. But I'd prefer a one-to-one mapping between timeofday and the filename, so, using the
transliteration operator 'y', along with the most common letters (but including all of the vowels, even 'y'):
use strict;
use warnings;
use Time::HiRes qw/gettimeofday/;
while (1) {
my $fname = create_filename_from_current_time();
print "Filename is '$fname'\n";
}
sub create_filename_from_current_time {
(my $fname = gettimeofday) =~ y/0-9/etaonirsuy/;
return $fname;
}
This produces output of the sort:
Filename is 'taotiaueta.retry'
Filename is 'taotiaueta.retso'
Filename is 'taotiaueta.retsu'
Filename is 'taotiaueta.retuo'
Filename is 'taotiaueta.retuu'
Filename is 'taotiaueta.retya'
Filename is 'taotiaueta.retys'
Filename is 'taotiaueta.reaea'
Filename is 'taotiaueta.reaes'
Filename is 'taotiaueta.reatt'
Filename is 'taotiaueta.reatr'
Filename is 'taotiaueta.reaat'
Filename is 'taotiaueta.reaai'
Filename is 'taotiaueta.reao'
I like that the "
extension" of the first filename in the list is coincidentally a real word!
s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/