in reply to (tye)Re: END blocks created at run time?
in thread END blocks created at run time?
Now you can add other things dynamically as well, using one mechanism, just by passing a coderef (usually a closure).BEGIN { my @coderef; END { $_->() for @coderef } sub atEND { push @coderef, @_ } } ... sub new_tempfile_name { ... atEND(sub { unlink $name }); return $name; }
-- Randal L. Schwartz, Perl hacker
|
|---|