Temporary file handling in Perl