Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
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 exploiting the Monastery: (15)
As of 2014-10-30 16:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (208 votes), past polls