in reply to HTML link to a temp file

If you're using IO::File->new_tmpfile, that file will be automatically deleted when closed. You want File::Temp instead