in reply to Re: How do I read all files in a directory recursively?
in thread How do I read all files in a directory recursively?
Either that, or the recurse_dir function could chdir in to each directory and chdir .. after the while loop.sub recurse_dir { my $dir = shift(); opendir D, $dir; while (readdir D) { process_file ($dir/$_) if -f $dir/$_; recurse_dir ($dir/$_) if -d _; } closedir D; }
|
|---|