Perl Monk, Perl Meditation | |
PerlMonks |
Re: If statement problem with hash valuesby tlm (Prior) |
on Jun 15, 2005 at 17:17 UTC ( [id://466977]=note: print w/replies, xml ) | Need Help?? |
This is the kind of problem for which I find the debugger invaluable (e.g. perl -d my_script.pl), as a quick tool to test the values of variables. Various hypotheses (such as "maybe there is trailing whitespace in the hash keys") as to the values of variables can be tested quickly with this tool. See perldebug. Small point: the lines in @subject are chomped twice. (I don't think this is the cause of the problem.) I think the problem is that you need $elements[2], not $elements[3]. Update: Upon closer inspection, I see an extra | that I missed before, so my last comment above is wrong. the lowliest monk
In Section
Seekers of Perl Wisdom
|
|