|
|
| "be consistent" | |
| PerlMonks |
Re^3: Boolean counter?by ikegami (Pope) |
| on Dec 07, 2009 at 18:37 UTC ( #811598=note: print w/ replies, xml ) | Need Help?? |
|
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.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||