ewittry has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to find all subdirectories between a min and max depth.
Note: I am testing this on Linux, but also need it to run on windows.
use strict; use File::Find::Rule; my $directory ="/vol/engtemp/IMFT-RND/FAB4_YE/www/es/"; my @subdirs = File::Find::Rule->mindepth(1)->maxdepth(9)->directory->i +n( $directory ); foreach my $subdir (@subdirs){ print "$subdir\n"; }
ummm.. I think I figured it out. Never fails when you ask somebody for help, a light bulb goes off. If I take the last "/" off of my $directory string, then it works... Now can some one explain why it didnt work with the "/" at the end?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help on File::Find::Rule Please
by ww (Archbishop) on Jan 12, 2012 at 14:49 UTC | |
|
Re: Help on File::Find::Rule Please
by toolic (Bishop) on Jan 12, 2012 at 14:36 UTC |