There is both a function interface and an object-orientedinterface.
The File::Temp constructor or the tempfile() function return the name and the open filehandle of a temporaryfile.
tempdir() create a temporarydirectory.
- ($fh, $filename) = tempfile($template, UNLINK => 1);
the file isautomatically removed when the program exits (dependent on$KEEP_ALL).
定义
my ($tmpfh,$tempfname)=tempfile($template,UNLINK=>1,
SUFFIX=>'.log');