in reply to Re^2: Filter and writing error log file
in thread Filter and writing error log file

Hi, you could have a number of next statements to discard records that are not good. For example:
while (<$IN_FILE>) { chomp; next if /[^ACTG]/; # removes lines with other letters next if length != 19; # removes lines not 19 char long # I just made up the next rule for the example next if /(.)\1\1/; # removes lines where the same letter comes th +ree times in a row # etc. # now start doing the real processing # ... }
The next statement goes directly to the next iteration of the while loop, so that faulty lines are effectively discarded early in the process.

Replies are listed 'Best First'.
Re^4: Filter and writing error log file
by newtoperlprog (Sexton) on Jul 23, 2014 at 20:31 UTC
    Thanks Laurent_R for the suggestion :-)