"Constant" declarations in Perl are not quite what you might expect them to be based on your experience with other languages. Pay particular attention to the "technical notes" and "caveats" in
perldoc constant, and to the inline-functions documentation referenced therein.