in reply to Read from directory list...
#!/usr/bin/perl -w my @files = <*.pl>; # get list of .pl files in this dir my @content; foreach my $file (@files) { if (-f $file && open(FH,"<","$file")) { @content= (@content, <FH>); # add filecontent close(FH); } } # optionally: chomp @content print "$_" foreach @content;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Read from directory list...
by johngg (Canon) on Feb 06, 2007 at 23:31 UTC |