in reply to joining to files into columns

You've got a loop within a loop, when you want just one loop going through both files. Change the line that reads "for my $file2 (<IN2>){" to "$file2 = <IN2>;", and remove the corresponding bracket for the "for" loop, and you should be OK

Replies are listed 'Best First'.
Re^2: joining to files into columns
by blazar (Canon) on May 19, 2006 at 10:09 UTC

    This kind of has also been discussed extensively only a few days ago in this thread.

    <shameless self="ad">
    My solution generalized to an arbitrary number of files and lines per file. Since the requirements here are slightly different, a trivial modification is in order.
    </shameless>