Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Reading the same file from all the subdirectories

by GrandFather (Sage)
on Sep 06, 2012 at 05:28 UTC ( #992007=note: print w/replies, xml ) Need Help??


in reply to Reading the same file from all the subdirectories

Something like the following (untested) code perhaps?

opendir my ($scan), $path or die "Can't scan folder $path: $!\n"; while (my $entry = readdir $scan) { next if ! -d "$path/$entry" || $entry !~ /^d[1-5]$/; next if ! -f "$path/$entry/list.txt"; ... }
True laziness is hard work

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://992007]
help
Chatterbox?
LanX revealed by his flat jokes?
[erix]: by his far-sightedness
[erix]: (oops, no dash)
[karlgoethebier]: isn't the earth flat?

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2017-10-24 12:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (289 votes). Check out past polls.

    Notices?