in reply to Find directories lt 7 days old
This works for me:
use strict; use warnings; use File::Find::Rule; my @dirs = File::Find::Rule ->directory ->mtime( '>' . (time - (60 * 60 * 24 * 7)) ) ->in( '.' ) ; print "$_\n" for @dirs;
The tricky part is what to pass to mtime() ... you need to subtract 7 days from the current Epoch (via time) and anything greater than that result falls within the past 7 days. You will need to install File::Find::Rule.
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Find directories lt 7 days old
by Jeri (Scribe) on Apr 01, 2015 at 16:25 UTC |