home *** CD-ROM | disk | FTP | other *** search
- # Concatenate a set of files, with a header at the start of
- # each, and with each file line numbered.
-
-
- # First, expand wildcards in the argument list...
- # (This can be used as standard bolt-in code for other scripts)
-
- foreach (@ARGV)
- {
- push(@a,<${_}>);
- }
-
- @ARGV = @a;
-
- # OK, now cat the files
-
- while (<>)
- {
- print "\n", $ARGV, "\n", '-' x length($ARGV), "\n" if ($. == 1);
- printf "%5d %s", $., $_;
- close(ARGV) if (eof);
- }
-