in reply to Can I open a specific file (eg. '.log') without knowing the actual name of it?
glob.
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 Section
Seekers of Perl Wisdom