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
In reply to Many actions at END
by merlyn
in thread END blocks created at run time?
by lemmett
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |