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

Re^3: Variable Declaration

by nobull (Friar)
on Aug 31, 2007 at 16:11 UTC ( #636363=note: print w/replies, xml ) Need Help??


in reply to Re^2: Variable Declaration
in thread Variable Declaration

A third option is
my $var2 = do { if ( <cond1> ) { a; } else { y; } };

All three constructs are more-or-less interchangable and which one you use should be decided based on which is most readable in any particular instance.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2021-04-23 07:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?