in reply to Re^5: is there a way to ensure some code is the last thing that is run? (SUPEREND)
in thread is there a way to ensure some code is the last thing that is run?
I'm still wondering what you mean.
This package is guaranteed to run the last possible (Perl coded) DESTROY, because the ref counter of $persist will only turn 0 after all wrapper ran. (see proof of concept)
And you can put your desired code in that DESTROY.
Furthermore you have full control of "SUPEREND" and all "created objects" (which would be handled by the same DESTROY() anyway)
Of course there is still destruction happening afterwards, namely subs and package variables, but these are hard coded.
And I wonder how you possibly want to run any code after destruction of subs???
You stated you need to run the code to fix issues with misbehaving foreign modules.
If this doesn't help, then it's most probably an XY Problem on your side
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
|
|---|