in reply to if conditional in nested for loop
As a stylistic note which has nothing to do with your present query, using foreach loops in place of C-style for loops will make your code less prone to typographical bugs, e.g.
my $counter = 1; foreach my $iseg (1 .. $nseg){ foreach my $ires ($beginning[$iseg] .. $ending[$iseg]) { if ($ires == $interdomainatoms[$counter]) { print STDOUT $interdomainatoms[$counter]; $counter++; } } }
See For Loops for details.
|
|---|