in reply to Check Directories for Files
If you really want all Bxx dirs, then @dirs could be simplified using glob.use strict; use warnings; use File::Slurp qw(read_dir); my $path = 'D:/DOWNLOAD/DISTRBTN/I01/B'; my @dirs = map { sprintf "$path%02d/", $_ } 1..22, 50, 60, 70, 80, 97; for my $dir (@dirs) { my @files = grep { -f "$dir/$_" } read_dir($dir); # do something with files }
Update: added grep to just get files.
|
|---|