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);
In reply to Re: Can I open a specific file (eg. '.log') without knowing the actual name of it?
by suaveant
in thread Can I open a specific file (eg. '.log') without knowing the actual name of it?
by trouble
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |