$hashofstates->($key) << This attempts to access a SCALAR REFERENCE : "$hashofstates" , a totally different animal that does not exist.
The distinction between the hash and the hash-ref is the use of the DEREFERENCING operator "->".
You probably wanted:
Also note the use of Curly brackets (Not parens) to contain hash keys.$hashofstates{$key}
"You're only given one little spark of madness. You mustn't lose it." - Robin Williams
In reply to Re: Error hash declaration
by NetWallah
in thread Error hash declaration
by sidsinha
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |