in reply to Unable to extract value from hash table
Check the output of
use Data::Dumper; print Dumper \%TAGS;
$VAR1 = { 'CONST_STR' => 1 };
You're using the => when you don't mean to:
The => operator is a synonym for the comma, but forces any word (consisting entirely of word characters) to its left to be interpreted as a string (as of 5.001). This includes words that might otherwise be considered a constant or function call.
Solutions:
my %TAGS = ( CONST_STR, CONST_ID ); my %TAGS = ( +CONST_STR => CONST_ID ); my %TAGS = ( CONST_STR() => CONST_ID ); my %TAGS = ( &CONST_STR => CONST_ID );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Unable to extract value from hash table
by dr_dunno (Novice) on Apr 09, 2008 at 06:24 UTC | |
by ikegami (Patriarch) on Apr 09, 2008 at 06:40 UTC | |
by dr_dunno (Novice) on Apr 09, 2008 at 06:45 UTC | |
by ikegami (Patriarch) on Apr 09, 2008 at 06:49 UTC |