in reply to Search for oldest file in directories and its subdirectories

Hi!

You might want to change your algorithm .. no need to store all directories to arrays.

Try the following

1) create 2 vars ($oldest_name; $oldest_age) and initialize the age to 0
2) pass through all files using File::Find (e.g. find(\&checkfile, $path);) - you'll need File::Find for this
3) in your callback-sub (e.g. checkfile) check if the current file is older than the oldest you found till now; if yes, store the data to your $oldest-variables (hint: File::stat might be helpful here)

now (when find() is finished) you have found the oldest file :-)
HTH, Rata