http://www.perlmonks.org?node_id=1039418

james4545 has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I am newbie to perl and i am stuck in arranging the output. Here is my problem.

I have N number of files that i process and get data such as :

file 1 output :

a
b
c
file 2 output:

2
f
4
s
w
i want the final output to be like this (arranged in column and comma separated):
a,2
b,f
c,4
,s
,w
Please note that the number of files can be in 100's , so i cant simply use join function. Thanks.