Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Boolean counter?

by ikegami (Pope)
on Dec 07, 2009 at 17:08 UTC ( #811561=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Boolean counter?
in thread Boolean counter?

Don't modify a variable that you're using elsewhere in an expression. At best, it's unclear. At worse, the result is undefined.

$toggle = - --$toggle;
should be
$toggle = -( $toggle - 1 );
which can be shortened to previously mentioned
$toggle = 1 - $toggle;


Comment on Re^3: Boolean counter?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2014-12-27 13:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (177 votes), past polls