in reply to skipping lines when parsing a file

hi,

ssandv gave you a good pointer. because from the code that you presented you are looping through a whole file and printing stuff, then exiting the loop keeping the file handle opened (which i strongly disapprove), then trying to capture something from the filehandle and then again repeating the first step.you gotta admit you intentions are a bit confusing ;) maybe something like this will help:

use strict; ... my $trigger = 0; while(<$in>){ print $out $_ if ($trigger == 0); $trigger = 1 if ($_=~/match something|or something else/g); $trigger = 0 if ($_=~/match something|or something else/g); }
this wasn't tested due to having nothing to test it on, but you can try to embed it and try it on a real data to see...

cheers