We'd really need to see the code in order to explain what is or isn't happening.
Having said that, it would be better to put them in a separate module file (e.g. MyConstants.pm) then use MyConstants;. This allows you to use your constants in whatever scripts you want without polluting your namespace with whatever else is in globals.pl.
You can then make a decision whether you want to export the constants automatically (not generally recommended), export them on request (a much better alternative) or you can access them by name (e.g. MyConstants::ERROR).
Here's some doco that may help: constant, Const::Fast, Readonly and Exporter.
-- Ken
In reply to Re: How to import constants from another perl script
by kcott
in thread How to import constants from another perl script
by stevenswj
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |