in reply to Oldest file using -M
Why does this look familar? Why, it's one of our Llama exercises!my @names = glob "*" or die "Nothing to scan"; my $oldest_name = shift @names; my $oldest_age = -M $oldest_name; for (@names) { # remaining names if (-M > $oldest_age) { $oldest_name = $_; $oldest_age = -M _; } } printf "%s is %.2d days old\n", $oldest_name, $oldest_age;
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: •Re: Oldest file using -M
by Gerard (Pilgrim) on Apr 27, 2004 at 20:40 UTC |