my $should_print = 1; while (...) { print "'\n" if ($should_print? --$should_print : 1); # munging ... }