noslenj123 has asked for the
wisdom of the Perl Monks concerning the following question:

I am working on a program that has several hundred constants and I'm trying to figure out a good way to include those via a required file or a used module. I've run into problems and looking for advice.

I receive: 'Bareword "OPEN_REQ" not allowed while "strict subs"'. I had thought for some reason requiring a file is like inserting that code at that spot in the script. Is it a compiletime vs runtime issue?

If I use a module, what is the briefest way to pass my large number of declared constants into the main namespace without retyping everyone of them into @EXPORT?

The way I used to do it was to essentially use a source filter: I'd have a BEGIN block inside my Definitions.pm file
read the file itself in and look for "use constant" lines:
Constant Amusement (auto export trick)

Anyone doing a lot of work with perl constants might want to
skim through those talk notes, by the way. And in general,
these days I'd recommend staying away from constants altogether -- their utility rarely makes up for their annoyances (e.g no sigil, so they don't interpolate very smoothly). Also a case can be made for keeping definitions of things in a YAML file instead of using perl code to store configuration (programmatic modification of YAML is a lot easier than parsing perl).

Wow, that distribution is a poster-boy for how to (ab)use Module::Build. The author creates his modules on the fly during the build process, which is kinda nuts. More importantly, he pre-generates a list of constants ahead of time, then the modules end up explicitly listing every constant. The resulting files are going to look ... well ... ugly.

Now, the process the author uses is kinda nice. Maybe that should be replicated, but definitely not the resulting code.