I'm not aware of any easy way to do so, and in general I don't think this is something perl necessarily wants to (or can - see below) make too easy.
Based on a quick look, the relevant code is in perl.c:Perl_destruct():
and it should be possible to mock up something based on this. The tricky part is determining whether you should remove the entries after calling them so that they won't be called again, and depending on the nature of your application it is quite possible that you won't know whether or not to do that in each case without first determining the purpose of that particular END block. Which is likely to be a bit tricky.if(PL_exit_flags & PERL_EXIT_DESTRUCT_END) { ... if (PL_endav && !PL_minus_c) call_list(PL_scopestack_ix, PL_endav); ... }
Hugo
In reply to Re: Is possible to force the execution of a END block at runtime, without need to start global destruction?
by hv
in thread Is possible to force the execution of a END block at runtime, without need to start global destruction?
by gmpassos
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |