Opening a directory and readdir with a grep in there to find specific
filenames, how does that process collect the files?

I mean will the generated @ar of files be oldest first or someother
reliable order?

Using an example paraphrased from perldoc -f readdir:
(I changed the regex)

  opendir(my $dh, $some_dir) || die "can't opendir $some_dir: $!";
  my @a_ar = grep { /^a/ && -f "$some_dir/$_" } readdir($dh);
  closedir $dh;

Will all the files beginning with `a' that make it to @a_ar, always be
in order of modtime, oldest first? Or some other reliable order?

Also, is there a similar reliable way files are processed when using
File::Find?

The perldoc page mentions that its depth first, but then what. What
factors are considered in choosing a file to process?

Of course, I mean beyond whatever specifications the script imposes.





-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to