If I understand your question correctly, what you are asking for is exactly what our provides. You just need to use a fully qualified name when outside the package.
See the first example in the docs: https://perldoc.perl.org/functions/our.html
In reply to Re: Is 'use vars' really obsolete?
by swl
in thread Is 'use vars' really obsolete?
by jnorden
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |