Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: Boolean counter?

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


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

The difference is that $toggle ^= 1; leaves you with a number (0 or 1) while $toggle = !$toggle; leaves you with a boolean.

Honestly, it sounds like the OP wants a boolean, so the easier to read negation should be used. If he wants to display the boolean, that's an outputting formatting issue to be resolved then.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://811598]
help
Chatterbox?
[Corion]: Discipulus: Yeah, I rediscovered it when I wanted to have a simple (cross-platform) wrapper for my OpenGL program so it has a nice window etc
[Corion]: ... and one thing leads to another, so ambrus provided the integration with AnyEvent so I can now conveniently make HTTP requests from that app too :)

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2016-12-09 09:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (150 votes). Check out past polls.