in reply to Working with a unkown number of arrays
If the loop completes having found @requests, they will have been selected from the highest non-empty qualifying directory and be sorted by creation/modification date. (updated)my @folders = glob 'input_directory*'; # get/sort all qualifying folde +rs my @requests; for (my ($found, %filedate); $found = pop @folders or exit();) { @requests = sort { { ( $filedate{ $a } ||= -M $a ) <=> ( $filedate{ $b } ||= -M $b ) } glob "$found/" . 'Flat_file.*.txt' and last; # reiterate iff none found }
-M
Free your mind
|
|---|