in reply to Is it possible to generate unique temporary filenames using hostname/process id?
$$ - see perldoc perlvar
hostname is not a builtin - see perldoc -q hostname
the combination of hostname and process id is however not a safe way to generate unique strings in general:
One process will not change it's process id, but some former process will have had the same id before. Also a potential attacker could reasonably succesfully guess a future process id and create/manipulate such a file.
Edit:
There's this module on CPAN: File::Temp return name and handle of a temporary file safely
Sören
|
|---|