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

Re: if/else syntax

by Herkum (Parson)
on Jun 26, 2009 at 16:03 UTC ( #775098=note: print w/replies, xml ) Need Help??


in reply to if/else syntax

The closest thing I can think of, is using a return statement in your call. So you have to be specific in your usage. FYI, I use this syntax all the time because it is very easy to read.

sub checkConditions { my $value = shift; return someFunc() if $value == 0; return otherFunc(); }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://775098]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2018-06-23 18:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (125 votes). Check out past polls.

    Notices?