title: perl script to delete lines from file
body: <p>I have a file that I want to read it and for each 'word' found to delete the next 2 lines including the line with the 'word'.
   the structure of the file is somekind line this:</p>
  
  <pre><code>1
  2
  3
  word
  321
  3213
  412
  word
  132
  1231
  </code></pre>
  
  <p>this is what I have until now:</p>
  
  <pre><code>open FILE, "$localDir\\x.txt" or die $!;
  @fileLines = &lt;FILE&gt;;
  close FILE;
  
  $output = 'y.txt';
  open my $outfile, '&gt;', $output or die "Can't write to $output: $!";
  
  for ($i = 0; $i &lt; scalar(@fileLines); $i++) {
         next if ($fileLines[$i] =~ /'word/);
           print $outfile $_ ;
  
  
  }
  </code></pre>
  
  <p>thanks</p>