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

Re: logical non-short-circuit operators

by hbm (Hermit)
on Nov 02, 2011 at 18:55 UTC ( #935470=note: print w/ replies, xml ) Need Help??


in reply to logical non-short-circuit operators

Is it too unwieldy without placeholder variables, like this?

if ($recFono->field_as_text(102) or $recFono->field_as_text(104)) { something(); }

If so, can your data structure be more concise? Perhaps if ($Fono->text(102) or $Fono->text(104)) {

Otherwise, as moritz says.


Comment on Re: logical non-short-circuit operators
Select or Download Code
Re^2: logical non-short-circuit operators
by december (Pilgrim) on Nov 02, 2011 at 18:58 UTC

    Hmm... I need the variables inside the conditional's code. I was just hoping to avoid having to make the assignments outside of the conditional block (and hence outside of its local namespace).

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2014-12-28 17:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (182 votes), past polls