my $oldest; my $oldtime = 0; for (glob "$dir/*.pl") { my $thistime = -C; if ($thistime > $oldtime) { ($oldest, $oldtime) = ($_, $thistime); } }