Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: if-elsif-else (?)

by Albannach (Monsignor)
on Jul 02, 2011 at 16:04 UTC ( [id://912472]=note: print w/replies, xml ) Need Help??


in reply to if-elsif-else (?)

Just to add to the other responses, because the else is usually used, I would consider it good practice to at least have a comment explaining that it is deliberately omitted and why. I've commonly seen the else included but with no statements, just to show to future maintainers that it is not an error but by design. It may also be worthwhile to add a logging call in the else so it won't appear to your user, but it might provide useful information to you on what real-world data looks like. You may think now that you know all possible input cases, but the world has a way of changing things without telling you. At least my world does!

--
I'd like to be able to assign to an luser

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (3)
As of 2026-01-22 22:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (125 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.