http://www.perlmonks.org?node_id=916872


in reply to Re: orderly global destruction? blessed references gone? XS ok
in thread orderly global destruction? blessed references gone? XS ok

END { $global = undef; }

That END block is in main/caller's package, not the $global's package. A PM/Class can't control where its instances stored (lex or global). The programmer of the PM doesn't write where the PM is used. Are you suggesting a package weakref list/hash and an END block in the same package in the that destroys all live instances of that package?