in reply to date sorted files into an array

Perl offers two other ways to get files: glob and readdir.
@files = glob "*.c"; # glob uses shell-like wildcards
opendir DIRHANDLE, "." or die "couldn't open directory ."; @files = readdir DIRHANDLE; closedir DIRHANDLE;
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:
@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

    Great!! but that will limit the search to the past few days. It will not fetch the newest files outside the date range. It would be appropriate to get the latest available files irrespective of the current date or a specified date

      What the previous post mentions will get all the files, if you dont do the grep command. (the last command, separated from the others). You should probably do some reading. For this one, read about opendir().

      There is plenty of great documentation about built-in commands at perlmonks, but you should also get some books. I'd start with Programming Perl, published by O'Reilly & Assoc, if you have reasonable programming experience in other languages. - Its a great reference, particularly Chapter 29: Perl Funcitons in Alphabetical Order

      If you're new to programming in general, you may want to get O'reillys Learning Perl