in reply to cat -ing Multiple files with Perl
Put your list of files in @ARGV and then use <>.
#!/usr/bin/perl use strict; use warnings; @ARGV = ('file2.txt', 'file4.txt', 'file15.txt'); open SEL, '>', 'selected.txt' or die $!; while (<>) { print SEL; }
"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: cat -ing Multiple files with Perl
by radiantmatrix (Parson) on Dec 07, 2005 at 15:43 UTC | |
by psychotic (Beadle) on Dec 07, 2005 at 16:05 UTC | |
by Anonymous Monk on May 28, 2010 at 23:47 UTC |