in reply to Calc distance between atoms in pdb file
Before your foreach loops, you can check the number of elements in the arrays:
print scalar(@arrayx), "\n"; print scalar(@arrayy), "\n"; print scalar(@arrayz), "\n";
If that doesn't solve it, add print statements inside your foreach loops.
Another good practice is to check if your regex matches:
if (@line = $_ =~ m/^(.....).(.....).(....).(...)..(....)....(........ +)(........)(........)/) { $x = $line[5]; $arrayx[$num] = $x; # more code }
See also:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Calc distance between atoms in pdb file
by stellaparallax (Novice) on May 01, 2012 at 00:32 UTC | |
by Anonymous Monk on Nov 14, 2016 at 15:47 UTC |