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