in reply to Find directories lt 7 days old

Un Now tested, it does in fact select only directories which have been recently updated:
foreach my $dirnam (@dirnames_I_found) { if ( (-M $dirnam) < 7 ) { print " $dirnam\n"; } }

Replies are listed 'Best First'.
Re^2: Find directories lt 7 days old
by Anonymous Monk on Apr 01, 2015 at 16:11 UTC
    Monks really should stop posting untested code ... getting the first reply is not the goal here.

    Your code does not even handle traversing directories or even how to obtain the directories to inspect.

      It has been my experience that use of opendir/closediror File::Findand its ilk does not generally elude a Seeker who quotes the use of a CPAN module in their question.

      I do find, however, that use of -Xfrom perlfuncdoes often elude folks who do not use Perl on a regular basis.

      I provided an example of that built-in functionality which most closely matched what I felt Jeri was seeking.

      I would also note that my then-untested code worked without modification once tested.