ursday, September 26, 2002 8:33 AM
To: [EMAIL PROTECTED]
Subject: [Perl-unix-users] List of directories in a directory
How do I get a list of directories within a directory into an array ?
Can I remove directories containing files in perl ?
Thanks
[EMAIL PROTECTED] wrote:
> How do I get a list of directories within a directory into an array ?
Untested:
opendir DIR, $dir or die "opendir $dir: $!";
my @dirs = grep { -d && ! /^\.{1,2}$/ } readdir DIR;
closedir DIR;
> Can I remove directories containing files in perl ?
use File::Path;
rmtre
How do I get a list of directories within a directory into an array ?
Can I remove directories containing files in perl ?
Thanks
Kobby
_
This transmission has been issued by a member of the HSBC Group
"HSBC" for the information of the ad