##
use IO::File;
my $fh = IO::File->new("/tmp/myprocess.tmp", "w");
if (defined $fh) {
...
$fh->close;
}
##
##
use Fcntl;
use POSIX;
my $name;
do {
$name = tmpnam();
} until sysopen(FH, $name, O_RDWR|O_CREAT|O_EXCL, 0666);
##
##
use IO::File;
my $fh = IO::File->new_tmpfile;