in reply to Re^2: Bit of maths between two files
in thread Bit of maths between two files
$file = shift@ARGV; $file2=shift@ARGV; open (FILE, "<$file"); while (<FILE>) { @array = ( ); chomp; ( $x, $y, $z) = split (/\s+/, $_); push @array, $x; $size = @array; } open (FILE2, "<$file2"); while (<FILE2>) { ($x1, $y1, $z1) = split (/\s+/, $_); for ($i=0; $i<$size;$i++) { $sum = $x1+$array[$i]; print $sum; } #print $sum; }
|
|---|