in reply to Opening every directory in the current directory

You want to get a list of the entries in a given directory that are also directories. This is done with readdir() and the -d test:
opendir DIR, $some_directory or die "can't read $some_directory: $!"; @dirList = grep -d "$some_directory/$_", readdir DIR; closedir DIR;
Please read the appropriate documentation (perlfunc).

japhy -- Perl and Regex Hacker

Replies are listed 'Best First'.
Re: Re: Opening every directory in the current directory
by runrig (Abbot) on Feb 10, 2001 at 02:53 UTC
    You may as well get a list of the just the directories with the desired file, or else the open() in the original post's code will fail:
    @DirList = grep { -f "$some_directory/$_/foo/bar.txt" } readdir DIR;