Just be careful not to create circular dependencies. MyMod uses MyMod::db and vice versa. That's likely to cause trouble. Instead, refactor all your constants to MyMod::constants and use that in MyMod and MyMod::db. In MyMod you can import from MyMod::constants and still re-export them in @MyMod::EXPORT.
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
In reply to Re^5: Can't import constants in multiple namespaces
by xdg
in thread Can't import constants in multiple namespaces
by mje
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |