We don't bite newbies here... much | |
PerlMonks |
Re: Automatically deleting selected directories on program exitby hv (Prior) |
on May 13, 2005 at 10:15 UTC ( [id://456657]=note: print w/replies, xml ) | Need Help?? |
Hmm, I'd be somewhat concerned about this, purely because it is relying on effects during global destruction - I don't know exactly what order things happen during this phase, but based on bug reports I've seen it seems possible that in some cases some or all of the strings in the $on_close arrayref may get destroyed before $on_close itself. If I remember correctly, the symptom would be "use of uninitialised value ... during global destruction", and one or more directories would not be cleaned up. However I do use DESTROY effects on scope exit a lot - if you were to wrap a block around the main program and declare $On_close within that block I'd have every confidence in it. Hugo
In Section
Seekers of Perl Wisdom
|
|