in reply to rm old directory

First, define what you mean by "60-day old directory." Do you mean the directory was created 60 days ago or the oldest file contained within it is 60 days old?

I believe that most O/S mark a directory as modified (change it's mod time) only if a file has been added or deleted (this includes moved), but not if a file has been changed, i.e., touching an existing file won't necessarily change the mod time on the including directory1.

The actual function you would is either rmdir or rmtree from the File::Path module. Unlink won't remove directories, unless "you are superuser and the -U flag is supplied to Perl." It also warns against using unlink to remove directories in all circumstances.


added in update

1 …of course, these same comments apply to directories within the top level directory, and their sub-directories, and so forth. Recursion!


Information about American English usage here and here. Floating point issues? Please read this before posting. — emc