Many times not logic names are necessary, MD5
can be used in here.
I'm using something like:
use Digest::MD5 qw(md5_hex);
my $secretText = "xpto";
my $counter = 0;
my $file_name = "";
$file_name = md5_hex($$.$^T.$secretText.($counter++)).".html";
} while -e $file_name;
The $secretText helps to create a not logic identifier since it is personal.
The $counter forces different text every time.