my $tmpfh = File::Temp::tempfile(); File::Copy::copy($file, $tmpfh); #### my($tmpfh, $tmpfile) = File::Temp::tempfile(UNLINK => 1); File::Copy::copy($file, $tmpfile);