Use -d to determine whether it is a directory. By the way, don't chop(), but chomp() if it is needed. The following code was tested on Windows XP, don't have UNIX access handy:
opendir(DIRHANDLE,"c:/") || die "file to open"; for my $file (readdir DIRHANDLE) { print "$file\n" if (-d "c:/$file"); } closedir(DIRHANDLE);
In reply to Re: get directory listing
by pg
in thread get directory listing
by darrengan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |