Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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


Comment on Re: Reading the same file from all the subdirectories
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2014-12-20 17:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (97 votes), past polls