in reply to Concatenating arrays fetched from different text files
Of course, you have to pass all the files to read from, from the CLI.use warnings; use strict; reader($_) for (@ARGV); sub reader { my ($filename) = @_; open my $fout, '>>', 'output_file.txt' or die "can't open file: $! +"; open my $fh, '<', $filename or die "can't open file: $! +"; while (<$fh>) { print $fout $_; } print $/; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Concatenating arrays fetched from different text files
by thanos1983 (Parson) on May 29, 2014 at 09:21 UTC |