something like: (i've not tested this!)
sure, this is not the fastest way (someone on the above referenced node timed the native find vs File::Find, with native winning by a factor of 5), but it's a way.my @found; File::Find::find({wanted => \&wanted], '.'); sub wanted { if (-d $_) && ($_ != '.') && ($_ != '..') { push(@found, $_) } }
also, be careful of the greps to remove the . and .. entries... it's legal to have directories that start with a period (or two, or more), so you have to do an exact match on both cases.
(i think)
i too am a newbie here, and i've been thanking people...
hopefully, i can provide some answers myself one day.
(ps: please forgive the expanded syntax, but it's (to my unPerlish eye) easier to read!)
In reply to Re: Re: Create a list of directories without . and ..
by u914
in thread Create a list of directories without . and ..
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |