in reply to Re: Re: Problem with constant pragma and some hash definitions
in thread Problem with constant pragma and some hash definitions

Globals aren't that bad. They are package scoped afterall, and very efficient too. If you use a convention, like consistently using uppercase for constants, you shouldn't have many problems. If you want to keep the constants private, you can use file scoped lexicals instead of globals and protect yourself even further.

A global hash isn't a terrible alternative, but the syntax is messy and you don't benefit from strict checking.

But a singleton? Ugh...

How about a tied scalar? (just kidding)

-sauoq
"My two cents aren't worth a dime.";
  • Comment on Re: Re: Re: Problem with constant pragma and some hash definitions