Looking at what you've done so far, you're basically there. Perhaps you're confused about how to output a properly formatted line? The last print statement you have will create an output file with no separation between the numbers (and no newline at the end). There are a number of ways (of course) to get it properly formatted. Some examples:
print OUT "$a $b $c\n";
printf OUT "%d %d %d\n", $a, $b, $c;
print OUT join(' ',$a, $b, $c), "\n";
The latter two will work better if you are going to do the addition inline, e.g.:
printf OUT "%d %d %d\n", $x+$x1, $y+$y1, $z+$z1;
Brad
|