There are many things that don't need to happen, and you haven't shown them to us:
for ($iseg = 1; $iseg <= $nseg; $iseg++){
For example, $nseg might be zero, undef or a negative number or some string.
for ($ires = $beginning[$iseg]; $ires <= $ending[$iseg]; $ires++)
+{
@ending might be empty or contain values numerically smaller than @beginning.
if ($ires == $interdomainatoms[$counter]) {
The same counts for @interdomainatoms.
You don't consider all these to be important, because you haven't shown them to us. So it must be something else that is not in the code you've shown at all. Maybe STDOUT is closed? |