in reply to Re^2: Bit of maths between two files
in thread Bit of maths between two files

Hi!

Try this:
my @file = @ARGV; my @coords; foreach $f (@file) { open (FILE, "<$f"); while (<FILE>) { my @line = split(/\s+/,$_); for my $i (0..$#line) { $coords[$i] += $line[$i]; } } close FILE; } print "@coords\n";
mawe

Replies are listed 'Best First'.
Re^4: Bit of maths between two files
by Anonymous Monk on Aug 05, 2004 at 16:22 UTC
    thanks for that, in addition how could i adjust this so that it sumsthe first x in file1 with first x in file2?