Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: If statement problem with hash values

by tlm (Prior)
on Jun 15, 2005 at 17:17 UTC ( #466977=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://466977]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2023-02-06 08:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (33 votes). Check out past polls.

    Notices?