Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Reading the same file from all the subdirectories

by pvaldes (Chaplain)
on Sep 07, 2012 at 10:31 UTC ( #992274=note: print w/replies, xml ) Need Help??

in reply to Reading the same file from all the subdirectories

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://992274]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (12)
As of 2016-10-28 17:48 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (386 votes). Check out past polls.