Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Replacing If Elsif Else with Hash

by sundialsvc4 (Monsignor)
on Nov 25, 2012 at 03:35 UTC ( #1005459=note: print w/ replies, xml ) Need Help??


in reply to Re: Replacing If Elsif Else with Hash
in thread Replacing If Elsif Else with Hash

I strongly agree with this ... no matter how exactly you choose to write the routine or to initialize the hash.

When writing this sort of logic, be extremely careful to test for the existence, or the absence, of the hash key ... not for “falsehood.”   Someday you will have a hash-entry whose legitimate value translates to false.   Or even maybe to undef.   It’s just a hungry sort of “gotcha” that’s just waiting for your glutes.


Comment on Re^2: Replacing If Elsif Else with Hash

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2014-08-31 10:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (294 votes), past polls