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