Assuming that you have control over MyObject.pm, perhaps the easiest solution is to use your constants internally to the module and accept a string in the constructor:
my $obj = MyObject->new(level=>'LOG_DEBUG');
You can use a hash to translate the level string to your internal code as required.
In reply to Re: Trying to understand the 'use constant' pragma
by GrandFather
in thread Trying to understand the 'use constant' pragma
by webengr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |