$$ - 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
In reply to Re: Is it possible to generate unique temporary filenames using hostname/process id?
by Happy-the-monk
in thread Is it possible to generate unique temporary filenames using hostname/process id?
by ashisht
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |