You may would like to try
our $MY_VARIABLE_AS_CONSTANT;
That's pretty much what I ended up doing; I like the 'keyword' appearance of constants though.
like STATUS_ERROR instead of $STATUS_ERROR :lol:
the other option is to have a package that exports functions in main:: namespace.
I tried something similar; to have a package that returns the STATUS_ERROR constant from a get_error_status() function, and check it with an is_error_status($) function.
That got hella convuluted after a while.
Moderator
Featured Poster
Reputation Points: 522
Solved Threads: 64
Veteran Poster
Offline 1,091 posts
since Jul 2006