Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: logical non-short-circuit operators

by JavaFan (Canon)
on Nov 02, 2011 at 21:33 UTC ( #935498=note: print w/ replies, xml ) Need Help??


in reply to logical non-short-circuit operators

Assuming that field_as_text doesn't return objects with weird overloaded bool logic:

no warnings 'uninitialized'; if (!!(my $num = $recFono->field_as_text('102') + !!(my $type = $recFono->field_as_text('104')) { something(); }
Although I would just write multiple statements:
my $num = $recFono->field_as_text('102'); my $type = $recFono->field_as_text('104'); if ($num || $type) { something(); }


Comment on Re: logical non-short-circuit operators
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (12)
As of 2014-11-27 09:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (183 votes), past polls