in reply to Retrieving a List of directories only

Your sub is called for each encountered file or directory. So, if a directory has 5 files in them, you push the directory 5 times on the array.

You need something like (untested):

find (sub {push @dirs => $File::Find::name if -d});
The fact that it takes "ages" is that it's going to traverse your entire file hierarchy. If you have a million files, the sub will be called a million times.

Abigail