in reply to Use of Constants

You appear to have a solution to your immediate problem.

As you're new to Perl, I'll draw your attention to constant - CAVEATS. Not knowing that in certain circumstances you need to prepend +, or append (), to your constant names can be a source of problems that can be hard to track down.

Readonly was suggested above. While this module addresses the use constant issues, it also has its drawbacks: see the CONS section in its documentation.

Another alternative is Const::Fast. This addresses both the constant and Readonly issues but has its own CAVEATS.

-- Ken