in reply to Re: Safe Temp Files
in thread Safe Temp Files
I would recommend using File::Temp. I think it is equally safe/reliable, gives more portability (to older Perls), and gives more flexibility.
For example, if you want your temporary files to stick around for inspection during debugging, you can just tell File::Temp not to unlink them on exit if debugging is on.
use constant DEBUG => 1; my $fh = File::Temp->new( UNLINK => DEBUG ? 0 : 1 );
If you're in the habit of using File::Temp, you'll always have the full flexibility it gives available to you.
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
|
|---|