in reply to Re^2: What is the correct way to clear package?
in thread What is the correct way to clear package?

> It's not required behavior.

Well, it's not our fault if you don't clarify your requirements... It was a struggle to find out what you exactly want.

> It clears nested packages.

2 Thoughts:

  1. Symbol::delete_package is plain perlcode, you could just adapt it to your needs.
  2. If you want to rely on Symbol been kept adapted to any future changes, why not just safe away the globs of nested packages, apply delete_package() and then reassign the globs? You already have the necessary code in the OP.

Cheers Rolf