in reply to Dir Structure Print out
In addition to the other comments above, I would like to make the following two small additional comments:
- There is a great potential for an endless recursive loop to be established if your program processes a symbolic link to a directory higher in the directory tree - This is a common trap that File::Find-like subroutines get caught by. To correct this, simply add a negative test for symbolic link with your -d test. ie.
- if (-d $dir && !-l _) { ... };
- And less importantly, the sort by_lc readdir(DIR) block in the op_dir subroutine could more easily be written as thus:
- foreach (sort { lc($a) cmp lc($b) } readdir(DIR)) { push (@dir, "$dir\/$_") if (m/$non_include/); };
Ooohhh, Rob no beer function well without!
|
---|
In Section
Code Catacombs