|P is for Practical|
Re: Listing old filesby Ratazong (Monsignor)
|on May 09, 2011 at 06:16 UTC||Need Help??|
Do you know what your code does?
Here you use File::find to go throgh a directory-structure - and call the function oldest on each file found.
In the function oldest you do some check on the file. As you see, the name of the file is passed to the function as $File::Find::name. (also in $_ ... but lets ignore that for now)
So all you need to do is to replace the code inside the function oldest by some code that prints the filename instaed. I'm sure you can do this without any further hint ... :-)
update reading your question again, I am wondering if you want to find the oldest file in each subdirectory. For that, I would propose the following approach: replace your scalar variables $age and $name by a hashes. And use the directory-name as the hash-key. You will find the directory-name in $File::Find::dir.