in reply to hash or nest loop

Seems to me it's much more simple to just (mostly pseudo-code)
# open FILE1 and FILE2 my ($f1, $f2); while (($f1 = <FILE1>) && ($f2 = <FILE2>) { # split and subtract and print with $f1 and $f2 as in other suggesti +ons. } # close all.
This way, while you do have two (probably three, with the printing and all) filehandles open, you don't have to slurp any of them.

Replies are listed 'Best First'.
Re^2: hash or nest loop
by Limbic~Region (Chancellor) on Sep 20, 2004 at 14:49 UTC
    Jasper,
    I am not sure if you looked at the desired output, but the AM said all the x values from file 2 subtracted from just the first x value in file 1. Your proposed solution would be corresponding x values, which I do not believe is desired.

    Cheers - L~R

Re^2: hash or nest loop
by Anonymous Monk on Sep 20, 2004 at 14:43 UTC
    but i guess the above is only useful if both files are of same size?