in reply to Reading multiple files one line at a time from arguments
For learning purposes I would appreciate if some one can suggest a more concise approach (even if it comes at the cost of readability).
Taking you at you word; you can do this extremely concisely with a one-liner:
perl -ple1 file1 file2 ...
Or, if you prefer it as a 'full program'; type this into a file called ptype.pl:
#! perl -pl
And then on your command line:
ptype file1 file2 file3 file4 ...
If you're using *nix, then it would have to be (something like):
#!/usr/bin/perl -pl
With the advantage of being able to use wilcards:
ptype *.pl *.txt
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reading multiple files one line at a time from arguments
by Anonymous Monk on Jun 19, 2014 at 04:26 UTC |