in reply to How to catch 'die' signal - CONVERSE case of #811295
Object::Destroyer can create destructors for resources that don't have one.
But since this resources is global to your program, END will do.my $lock_file; my $lock_file_destroyer = Object::Destroyer->new(sub{ unlink($lock_file) if defined($lock_file); }); ...
my $lock_file; END { unlink($lock_file) if defined($lock_file); } ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to catch 'die' signal - CONVERSE case of #811295
by puterboy (Scribe) on Dec 07, 2009 at 03:17 UTC | |
by ikegami (Patriarch) on Dec 07, 2009 at 04:53 UTC |