in reply to Can I open a specific file (eg. '.log') without knowing the actual name of it?
That'll put the name of the first file it finds in the directory that ends in .log and puts it in $file... otherwise $file stays empty...opendir(DIR, '.') or die $!; for(readdir(DIR)) { if(/\.log$/) { $file = $_; last; } } closedir(DIR);
|
|---|