The code should select list.txt from first directory and then process all the 10 list.txt files one by one from each of the 10 directories.
chdir "my_parent_dir"; my @files = glob("*/list.txt"); for my $item(@files){ open my $currentfile, '<', $item; .. do something... close $currentfile; } # and go to the next item of the loop
In reply to Re: Reading the same file from all the subdirectories
by pvaldes
in thread Reading the same file from all the subdirectories
by zing
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |