in reply to hash or nest loop

Hum... Sounds like homework to me. It would be better if you provided your code...
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);

Warning : this code is untested.

update : changed a indice error : 2 -> 0. Now the code is tested.

HTH

--
zejames

Replies are listed 'Best First'.
Re^2: hash or nest loop
by Anonymous Monk on Sep 20, 2004 at 13:47 UTC
    trying to pick up perl while studying in the field of bioinformatics thanks though u've helped me getting started!