in reply to Re^2: Bit of maths between two files
in thread Bit of maths between two files
mawemy @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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Bit of maths between two files
by Anonymous Monk on Aug 05, 2004 at 16:22 UTC |