$file = shift@ARGV; $file2=shift@ARGV; open (FILE, "<$file"); while () { ( $x, $y, $z) = split (/\s+/, $_); } open (FILE2, "<$file2"); while () { ( $x1, $y1, $z1) = split (/\s+/, $_); } open (OUT, ">output"); print OUT $x $y $z $x1 $y1 $z1; ###then do maths