in reply to Boolean counter?

Just to show that you can make a lot with "lookup-tables" ;-)

$counter = (1, 0)[$counter];

Rata

Replies are listed 'Best First'.
Re^2: Boolean counter?
by eyepopslikeamosquito (Bishop) on Dec 07, 2009 at 19:36 UTC

    Just to make "lookup-tables" prettier. ;-)

    $counter = [ 1 => 0 ] -> [ 1 <= $counter ];

      ug, you create two variables every time you toggle it (one of which is an array!), and you rely on the undocumented values of <= returns. And the latter doesn't help make it prettier at all!