• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 273
  • Last Modified:

DirList

Hello,

This code part is used to find the files ending with .lang in a dir $datalang.

opendir(D,"$datalang") or my_die("Error opening $datalang", $!);
while ($file=readdir(D)) {
if ($file =~ /(.*)\.lang$/) {
push(@dl,$1);
}
}
closedir(D);

How to get a list of sub-directories in the dir $datalang?
0
mmcw
Asked:
mmcw
1 Solution
 
prakashk021799Commented:
while ($file = readdir(D)) {
    if (-d $file) {
        push @dir_list, $file;
    } else {
    #  other processing
    }
}
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now