I am writing a perl script which there should be an array of arrays. This array finds all folders in the current directory and then the size of array depends on folders. The children arrays contains all files name which are included. It may I have an empty folder, but still I would like to create an array for that as well.
my $root = "myCurrenDir";
@test = grep { -d "$root/$_" } read_dir($root);
my @array = ? # how can be defined
Let's assume that in the current directory there are two folders. Then the parent array contains two arrays as children. (Maybe one is empty).
Then I want to check if (both of) arrays are empty or not and proceed to do next.
I googled but could not find a clear solution for that. May I ask your help? (maybe it is simple but I stick on!).
@testnow contains only directories, and you want to find all files in$rootand put them in@array?chdir $root; @array = grep -f,<.* *>