http://www.perlmonks.org?node_id=992007


in reply to Reading the same file from all the subdirectories

Something like the following (untested) code perhaps?

opendir my ($scan), $path or die "Can't scan folder $path: $!\n"; while (my $entry = readdir $scan) { next if ! -d "$path/$entry" || $entry !~ /^d[1-5]$/; next if ! -f "$path/$entry/list.txt"; ... }
True laziness is hard work