Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: use of strict ....by holcapek (Sexton) |
on Nov 05, 2006 at 09:16 UTC ( [id://582292]=note: print w/replies, xml ) | Need Help?? |
You declared (or whatever use utils did) a hash called %ERRORS. Yet later in the code, though you would like to get value of key CRITICAL of that hash, you used name ERRORS in this way and didn't know about it: {"CRITICAL"} is resolved as a block that returns value of its last expression, i.e. string "CRITICAL"; this value is considered to be a class name, and ERRORS as a method from this class; so, you're calling method ERRORS of class CIRITCAL, what would be rewritten like CRITICAL->ERRORS();. Hope this haven't confused you too much :-) Perl on.
In Section
Seekers of Perl Wisdom
|
|