Keep It Simple, Stupid | |
PerlMonks |
Re: Temporary file management in Perl -- is it possible?by kennethk (Abbot) |
on Apr 24, 2013 at 20:23 UTC ( [id://1030517]=note: print w/replies, xml ) | Need Help?? |
I'd say a cron job that removes files older than 10 minutes is in general cleaner, but one possibility would be fork and wait 10 minutes, a la:
Of course, for production, you'll want to test to make sure fork returns defined, probably set $SIG{CHLD}='IGNORE' (see perlipc) and a couple other clean-ups. #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.
In Section
Seekers of Perl Wisdom
|
|