Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Boolean counter?

by vitoco (Friar)
on Dec 07, 2009 at 12:47 UTC ( #811492=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      my %Next = ( 0 => 1, 1 => 0);
      my $Counter = 0;
      #...
      $Counter = $Next{$Counter};
    
  2. or download this
      $Counter = abs --$Counter;