in reply to joining to files into columns

That's because you read a line from file1 in the outer loop and, for that line, read and printed the three lines from file2 in the inner loop. If you can be sure that there are the same number of lines in each file you could do this (not tested).

use strict; use warnings; open(IN, "file1") || or die $!; open(IN2, "file2") || or die $!; open(OUT, ">>joinfile") || or die $!; while(defined(my $f1 = <IN>) { chomp $f1; my $f2 = <IN2>; print OUT "$f1 $f2"; }

That ought to do the trick. It is always good practice to put use strict; and use warnings; at the beginning of your scripts to help catch errors. Also, did you mean to append to "joinfile" with your use of >>? Use a single > to write to a new file or overwrite an existing one.

Cheers,

JohnGG