if ($array2[$el + 10] =~ /resid (\d+) and name (H\w+\d*).?\)/ and $array2[$el ] =~ /resid (\d+) and name (H\w+\d*).?\)/) { $resid = $1; $atomid = $2; if ($array2[$el + 10] =~ /resid (\d+) and name (H\w+\d*).\n?\)/) { $residmatch = $1; $atomidmatch = $2; } die "Can't open $distfil\ne" unless open DISTFILE, "$distfile"; while (defined($_ = )) { $line = $_; last if outputIf( $line, $atomid, $atomidmatch, $residmatch, $resid, $array2[$el] ); if ($array2[$el + 11] =~ /resid (\d+) and name(H\w+\d*).?\)/) { last if outputIf( $line, $atomid, $atomidmatch, $1, $2, $array2[$el] ); } elsif ($array2[$el + 12] =~ /resid (\d+) and name(H\w+\d*).?\)/) { last if outputIf( $line, $atomid, $atomidmatch, $1, $2, $array2[$el] ); } elsif ($array2[$el + 13] =~ /resid (\d+) and name(H\w+\d*).?\)/) { last if outputIf( $line, $atomid, $atomidmatch, $1, $2, $array2[$el] ); } elsif ($array2[$el + 14] =~ /resid (\d+) and name(H\w+\d*).?\)/) { last if outputIf( $line, $atomid, $atomidmatch, $1, $2, $array2[$el] ); } elsif ($array2[$el + 15] =~ /resid (\d+) and name(H\w+\d*).?\)/) { last if outputIf( $line, $atomid, $atomidmatch, $1, $2, $array2[$el] ); } } }