in reply to Problem with constant pragma and some hash definitions
Constants declared with use constant are problematic when used as hash keys. Constants are actually implemented as functions. In hash lookups and on the left hand side of a fat comma ('=>'), barewords are interpretted as strings rather than function calls. You can get the effect you want by prefixing them with a '&' and forcing them to be called as functions like this:
my %generator_lookup = ( &E_MESYSTEM => 'G_SYSTEM_SYSTEM_ID', &E_MEENTITY => 'G_ENTITY_ENTITY_ID', );
-sauoq "My two cents aren't worth a dime.";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Problem with constant pragma and some hash definitions
by flounder99 (Friar) on Jul 18, 2003 at 19:10 UTC | |
by sauoq (Abbot) on Jul 18, 2003 at 19:27 UTC | |
|
Re: Re: Problem with constant pragma and some hash definitions
by dbush (Deacon) on Jul 18, 2003 at 18:42 UTC | |
by Jenda (Abbot) on Jul 18, 2003 at 20:39 UTC | |
by particle (Vicar) on Jul 21, 2003 at 12:59 UTC | |
by sauoq (Abbot) on Jul 18, 2003 at 18:46 UTC | |
|
Re: Re: Problem with constant pragma and some hash definitions
by Anonymous Monk on Jul 21, 2003 at 22:59 UTC | |
by sauoq (Abbot) on Jul 22, 2003 at 02:45 UTC |