while () { if ($hit=/POLYMORPH/ ... /^\s*$/) { # This will be reached for each line from # POLIMORPH to the next empty line (including) # In order to exclude the first (POLYMORPH) # and the last (empty) line, we do next if $hit==1 || $hit=~/e0/i; # If we gut a line of data, we append them # to our array push(@final_gset, $_); # and get the next line next; } # This will be reached for anything else }