Beefy Boxes and Bandwidth Generously Provided by pair Networks BBQ
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: How do I recursively process files through directories

by 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.


in reply to How do I recursively process files through directories

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/");
  • Comment on Re: How do I recursively process files through directories

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1317]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.