Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: beginner scripting question re: if elsif else

by jhumphreys (Novice)
on Oct 11, 2012 at 21:08 UTC ( #998550=note: print w/ replies, xml ) Need Help??


in reply to Re: beginner scripting question re: if elsif else
in thread beginner scripting question re: if elsif else

kennethk-

Thanks for your reply. So, with if elsif else, if the first condition is true, the whole script still runs anyway (if no exits scripted)?

j.


Comment on Re^2: beginner scripting question re: if elsif else
Re^3: beginner scripting question re: if elsif else
by Dlamini (Novice) on Oct 11, 2012 at 21:17 UTC

    Yes, the first part of your code gathers information from the user, then the second part actually does something with it. The way you have it, it will ask all the questions, and get all the answers from the user BEFORE getting to the if/else section. Once it is in the if/else section, it will do as you suspect -- i.e. if it is snowing, then that satisfies the if condition and therefore the else conditions are skipped.

      Dlamini-

      Thanks! That's just what I needed to know.

      j.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2014-08-22 06:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (148 votes), past polls