in reply to Re^7: 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?

> A true SUPEREND-feature should work without such knowledge and that is I believe not possible.

It is, you can introspect all available packages (look into %main:: ) so far in a loop, check if DESTROY exists and install a wrapper.

Do you need it?

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

  • Comment on Re^8: is there a way to ensure some code is the last thing that is run? (SUPEREND)
  • Download Code

Replies are listed 'Best First'.
Re^9: is there a way to ensure some code is the last thing that is run? (SUPEREND)
by morgon (Priest) on Feb 03, 2017 at 16:01 UTC
    Hm, interesting idea.

    But I suppose the code in SUPEREND could dynamically create a new class with a destructor.

    At that time you've already done your introspection, so this destructor would not have been covered I suppose...

    And no, I don't really need it, I would only be interested if it was possible at all in the most general case...

      I don't understand your problems, but check CPAN I'm sure it already exists somewhere.

      Cheers Rolf
      (addicted to the Perl Programming Language and ☆☆☆☆ :)
      Je suis Charlie!