gotsilk has asked for the wisdom of the Perl Monks concerning the following question:
Ok, so below you will find all my code for the function, what it does is basically goes through the CWD and searches for all HTML files in it and the sub directories. I need help with is skipping one directory that i specify.
Update: Thanks Guys i will try both out and see which one works best for what i am doing, truly appricate it!our $newdir = "Pulled on $date"; mkdir $newdir; # i want the dftree to skip the $newdir only and continue on # after. Thanks! sub dftree(){ my $dir = shift; opendir (DIR, $dir) or die "Could not open directory $dir: $!" +; my @entries = map {"$dir/$_"} grep {!/^\.{1,2}$/} readdir(DIR) +; closedir DIR; for (@entries) { (-d) ? &dftree($_) :(/\.html$/)? &file_check($_): next; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need help with Omitting a directory from this function
by graff (Chancellor) on Aug 26, 2015 at 21:35 UTC | |
|
Re: Need help with Omitting a directory from this function (file find rule ignore directory )
by Anonymous Monk on Aug 27, 2015 at 00:31 UTC |