Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://992274]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2017-12-15 20:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (443 votes). Check out past polls.

    Notices?