in reply to Re^2: opening directories in perl
in thread opening directories in perl
The wanted() function does whatever verifications you want. $File::Find::dir contains the current directory name, and $_ the current filename within that directory. $File::Find::name contains the complete pathname to the file.So I'd try this to start (untested):
my @mlc; sub wanted { return unless $_ eq 'mlc'; push @mlc, $File::Find::name; } find(\&wanted, '.'); foreach my $file (@mlc) { open(my $fh, $file) or die "Can't open '$file': $!"; # per-file code goes here }
|
|---|