in reply to date sorted files into an array
@files = glob "*.c"; # glob uses shell-like wildcards
Either will get files or directories; glob by default will ignore names starting with a . To only get those files modified in the last 3 days (since the perl script started) and skip directories, you would then do:opendir DIRHANDLE, "." or die "couldn't open directory ."; @files = readdir DIRHANDLE; closedir DIRHANDLE;
@files = grep -f && 3 > -M, @files;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: date sorted files into an array
by Anonymous Monk on Aug 02, 2004 at 11:27 UTC | |
by shemp (Deacon) on Aug 02, 2004 at 15:39 UTC |