Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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: (6)
As of 2014-08-30 00:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (289 votes), past polls