in reply to Count folder/files in directory

To elaborate on starbolin's comment, this code in process:
$file_full_path = "$path/$_"; if (-d $_){ ... process($_);
should use $file_full_path instead of $_:
$file_full_path = "$path/$_"; if (-d $file_full_path){ ... process($file_full_path);
And you should be able to kick off the whole traversal by calling process with your top-level directory:
process($SOURCEDIR);
Do this will eliminate the while loop at the beginning of your program which essentially duplicates the code you have in the process subroutine.