in reply to How to get the names of sub-directory in a directory?
opendir(DIR, $some_dir) or die "Can't opendir $some_dir: $!"; my @subdirs = (); foreach (readdir(DIR)){ next if /^\.\.?$/; # skip . and .. push (@subdirs, $_) if -d "$some_dir/$_"; } closedir DIR;
Best regards,
perl -e "$_=*F=>y~\*martinF~stronat~=>s~[^\w]~~g=>chop,print"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How to get the names of sub-directory in a directory?
by japhy (Canon) on Feb 01, 2002 at 14:48 UTC |