Amemdment,
I didn't see that you also want the file names.
You can change the code to this:
use File::Find;
find (\&wanted, "$RootDir"

;
foreach (@array) {
print "$_\n";
}
sub wanted {
-f and push(@array,$File::Find::name);
}
I will return the full path (directory and filename) to each file in ALL directories, sub-directories, sub-sub-directories, from the starting directory that you specify. If for whatever reason you want to have a separate list of directory and filenames, you could do something like this:
use File::Find;
find (\&wanted, "$RootDir"

;
foreach (@array) {
print "$_\n";
}
sub wanted {
-d and push(@DirArray,$File::Find::name);
-f and push(@FileArray,$File::Find::name);
}
Additionally, if you want to find files of just a certain extension (say .html), then you can do something like this:
use File::Find;
find (\&wanted, "$RootDir"

;
foreach (@array) {
print "$_\n";
}
sub wanted {
/\.html/ or return;
-f and push(@array,$File::Find::name);
}