File::Temp is a Perl5 module which can be used to generate temporary files (providing a filename and filehandle) or directories. Possible race conditions are avoided and some security checks are performed (e.g. making sure the sticky bit is set on world writeable temp directories). WWW: https://metacpan.org/release/File-Temp