in reply to hash or nest loop
open F, "file1" or die "Problem with file1"; open G, "file2" or die "Problem with file2"; @file1 = map { (split /\s+/, $_)[0]; } <F>; @file2 = map { (split /\s+/, $_)[0]; } <G>; while ($coord2 = shift @file2) { $coord1 = shift @file1; push @result, $coord1 - $coord2; unshift @file1, $coord1; } open H, "> result.txt" or die "Unable to open result.txt"; print H join ("\n", @result);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: hash or nest loop
by Anonymous Monk on Sep 20, 2004 at 13:47 UTC |