opendir DIR, "/path/to/logdir/"; my @files = readdir DIR; closedir DIR; my $latest; for $file (@files) { next if $file =~ /^\.+/; $latest = (stat($file))[9] > (stat($latest))[9] ? $file : $latest; } print "Last Logfile: $latest\n";
In reply to Re: Assesing file timestamp
by physi
in thread Assesing file timestamp
by stew
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |