$buffer .= "$_\n"; } # Personally I prefer calling functions like this with an arg, rather than # relying on a globar ($buffer in this case). processbuffer(); sub processbuffer { print OUT $buffer unless $suppress; $buffer=""; $suppress = 0; }