Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: if variants

by SpanishInquisition (Pilgrim)
on Oct 19, 2004 at 12:37 UTC ( [id://400584]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Re: if variants
in thread if variants

Personally I like:

if ($i>1) { $a = function_that_may_fail(); $i = ($a) ? $i+1 : 1; }

I find that the only time I really use "and" and "or" are with carp/croak/warn/die. But that's just me.

At worst:

do { $a=function_that_may_fail(); $i= $a ? $i+1 : 1; } if ($i>1)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://400584]
help
Sections?
Information?
Find Nodes?
Leftovers?
    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.