Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 cooling their heels in the Monastery: (4)
As of 2015-07-30 01:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (269 votes), past polls