my $ff = 0; while( 1 ) { print $ff ? 'hee ' : 'haw ', "\n"; $ff = 1 - $ff; }