in reply to making 3 files into one

I would open each file and store them in separate arrays where each element of an array is a single line in the corresponding file. Open a fourth file for writing and use a for loop to print each element of each array.

for (my $i = 0; $i < $#file; $i++) { print FILE "$file[$i] $file2[$i] $file3[$i]\n"; }

Or something~

And you didn't even know bears could type.