in reply to Trying to understand the 'use constant' pragma
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Trying to understand the 'use constant' pragma
by webengr (Pilgrim) on Sep 07, 2005 at 02:35 UTC |