Scott McClanahan wrote: > > I'd like to skip those lines. I'd like to skip the line with "bar" and > the following five lines. In that case, the perl code would be: #!/usr/bin/perl $eat = 0; while (<>) { if (m/bar/) { $eat = 6; } if ($eat) { --$eat; } else { print; } } Again, not tested. Use at your own risk.