The builtin glob function will probably do what you want. Just make sure you check the "Portability issues" noted in that document.
Something like:
my @logfiles = glob "*.log";
then just iterate @logfiles, processing each in turn.
Because you said "... all of the files(many) in the same directory ..." you may exceed a maximum size. See GLOB_LIMIT in File::Glob for details.
If you are likely to approach that limit, a better option (although, a bit more coding) would be to use readdir.
You'll need to skip everything except normal files with a .log extension. Something like this (untested):
while(readdir $dh) { next unless -f and /\.log$/; # Process log file here }
See File Test Operators if you're unfamiliar with -f.
-- Ken
In reply to Re^3: Opening multiple log files
by kcott
in thread Opening multiple log files
by hahazeeq
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |