in reply to Re: Re: Re: How do I put all sub-directories into an array?
in thread How do I put all sub-directories into an array?
Giant, thanks for all your help with this.
In the end I used a modification of mugwumpjism's suggestion to get to where I wanted to be.
Here's the code:
This sticks all my virtual hosts in an array :).chdir "/home/www"; opendir DIR, "."; my @vhosts= ( # 1. This tests for the presence of directories grep { -d } ( # 2. this returns all directories but . & .. grep { !/^\.\.?$/ && -d } (readdir DIR) ) ); closedir DIR;
|
|---|