Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^4: Simple IF, IF, IF or ELSE

by abachus (Monk)
on Jun 28, 2006 at 22:47 UTC ( #558180=note: print w/replies, xml ) Need Help??

in reply to Re^3: Simple IF, IF, IF or ELSE
in thread Simple IF, IF, IF or ELSE

I'm not offended GrandFather, i'm a self taught idiot, hehe :) I'm here to benefit from others wisdom, and when the time is right (and i'm able) i'd enjoy passing that wisdom onwards.

I had to dash off to test a pint of beer in the pub, and after giving some careful thought as to why IF, IF, IF, ELSE would not work in the way i first put the code across, I came up with :

By using an IF statement, followed further IF statements brings AND into the equation, no ?

if(true){ do this } if(true){ do that } else{ do something else }

The first two IF's will return true and not 'do else' only if both IF's return true, maybe i'm wrong here, don't know, not yet have i read the suggested documentation, but i will do so shortly. No doubt there i will find my answer.

For too long i've used 'do stuff if(true)' and thats not the same thing, as i now know.

thanks for your patience,


Replies are listed 'Best First'.
Re^5: Simple IF, IF, IF or ELSE
by GrandFather (Saint) on Jun 28, 2006 at 22:58 UTC

    Rather than IF, IF, IF or ELSE, think IF. IF. IF or ELSE. The first two ifs are unrelated the the IF or ELSE - they don't affect it at all. They could be turned around into statement modifiers without changing the effect of the code at in any way.

    DWIM is Perl's answer to Gödel

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2022-08-09 01:13 GMT
Find Nodes?
    Voting Booth?

    No recent polls found