in reply to Can I open a specific file (eg. '.log') without knowing the actual name of it?

opendir(DIR, '.') or die $!; for(readdir(DIR)) { if(/\.log$/) { $file = $_; last; } } closedir(DIR);
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...
                - Ant
  • Comment on Re: Can I open a specific file (eg. '.log') without knowing the actual name of it?
  • Download Code