No such thing as a small change | |
PerlMonks |
Re: Boolean counter?by moritz (Cardinal) |
on Dec 07, 2009 at 08:21 UTC ( [id://811449]=note: print w/replies, xml ) | Need Help?? |
You can just use ++ to increment your counter, but when you ask for its value use $counter % 2 instead of the counter itself.
Or if you're not interested in the numeric value 0, but rather that it's a false value, you can also use this update step:
In Section
Seekers of Perl Wisdom
|
|