http://qs1969.pair.com?node_id=466977


in reply to If statement problem with hash values

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