use strict; use IO::File; my @logFiles = glob( '*.log' ); my @data; for ( @logFiles ) { # You can further limit your file names thusly: die "Weird File Name" if m/[^a-zA-Z0-9._-]/; my $fh = IO::File->new( '< $_' ) or die "Open Failed for '$_', $!"; push @data, <$fh>; # Do something with the file $fh->close(); }
In reply to Re: Can I open a specific file (eg. '.log') without knowing the actual name of it?
by Adam
in thread Can I open a specific file (eg. '.log') without knowing the actual name of it?
by trouble
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |