http://www.perlmonks.org?node_id=1003015


in reply to Override tempdir DESTROY

Write your own, tiny class. Have your class's new() construct the File::Temp object. Have your DESTROY do the steps needed (File::Temp's DESTROY will automatically be called when you clear the File::Temp object attribute from your your object or after your object gets cleared out). Your object could just be a blessed scalar reference to the File::Temp object, for example. Your new() can also do post-creation steps, if needed.

- tye