in reply to Boolean counter?

Just to prove you can use trigs to solve almost anything:
$counter = int cos $counter * atan2(1, 0);