|
|
| Come for the quick hacks, stay for the epiphanies. | |
| PerlMonks |
Re: How do I recursively process files through directoriesby nate (Monk) |
| on Dec 22, 1999 at 22:44 UTC ( [id://1317]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
Here's a bit of example code that I often use:
use File::Find;
sub eachFile {
my $filename = $_;
my $fullpath = $File::Find::name;
#remember that File::Find changes your CWD,
#so you can call open with just $_
if (-e $filename) { print "$filename exists!\n"; }
}
find (\&eachFile, "mydir/");
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||