For a start:
------------

my $months_dir = '.';
opendir(DIR, $months_dir);
my @months = readdir(DIR);
closedir(DIR);

foreach my $month (@months) {
        if (!-d "$months_dir/$month" || $month eq '.' || $month eq '..') {
                next; # skip if not dir, or if it is . or ..
        }
        opendir(DIR, "$months_dir/$month");
        my @days = readdir(DIR);
        closedir(DIR);
        foreach my $day (@days) {
                if (!-f "$months_dir/$month/$day") {
                        next; # skip if not file
                }
                # do stuff with $day file
                print "$months_dir/$month/$day\n";
        }
}


Geetha Weerasooriya wrote:
Hi ,
I have data files which are in different folders. I want to run the same
program on all the data files. For example I have 12 folders for 12
months of the year and each folder contains the files for each day of
the month. So one file contains 30 or 31 files. Can some one kindly guide me to do this? Or can you give any reference
material to study this type of data handling?
Thanks in advance. Best wishes, Geetha



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to