P is for Practical | |
PerlMonks |
Re: Concatenating arrays fetched from different text filesby 2teez (Vicar) |
on May 29, 2014 at 00:20 UTC ( [id://1087743]=note: print w/replies, xml ) | Need Help?? |
Hi thanos1983 I think basically, what you are trying to do is to concatenate several files, with little manipulations here and there, going by the sample of files as input and output at the end of your post. If that is right, then what I will advice is put the for loop to loop over the files outside the subroutine to read the files. By that you can get the names of the files to read from one after another and use your subroutine to read and write. Something to give a head up: Of course, you have to pass all the files to read from, from the CLI. Like: $ perl read_n_write.pl file1.txt file2.txt file3.txt ...
If you tell me, I'll forget. If you show me, I'll remember. if you involve me, I'll understand. --- Author unknown to me
In Section
Seekers of Perl Wisdom
|
|