<?xml version="1.0" encoding="windows-1252"?>
<node id="811439" title="Boolean counter?" created="2009-12-07 02:57:14" updated="2009-12-07 02:57:14">
<type id="115">
perlquestion</type>
<author id="624898">
DreamT</author>
<data>
<field name="doctext">
Dear Monks,&lt;br&gt;&lt;br&gt;
I'd like to have a counter that is boolean, so when you increment it, it should either become 0 or 1, based on it's previous value. I can do it like this:

&lt;code&gt;
		if ($Counter == 0)
		{
			$Counter = 1;
		}
		else
		{
			$Counter = 0;
		}
&lt;/code&gt;
, but I'd like to do the above in a more elegant way. Is it possible?</field>
</data>
</node>
