in reply to Temporary file management in Perl -- is it possible?
If the timer is the only one you need in your program, the most lightweight way would probably be to use File::Temp's UNLINK mechanism (it's a good idea to use this for tempfile creation anyway):
$tmp = File::Temp->new(UNLINK => 1); $SIG{ALRM} = sub { undef $tmp }; alarm(600);
However, you must be sure not to use that tempfile after the timeout. If you can be sure of that, question is why you don't just remove the file when you're done with it?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Temporary file management in Perl -- is it possible?
by taint (Chaplain) on Apr 24, 2013 at 23:43 UTC | |
by kennethk (Abbot) on Apr 25, 2013 at 14:48 UTC | |
by taint (Chaplain) on Apr 25, 2013 at 17:29 UTC |