Overall it looks clean and simple. Good job. Here are some things I noticed:
- You should use "use warnings"
use warningsfor production level code. ItsIt's odd that you use strictstrictbut not warningswarnings. - List::Util
List::Utilor List::MoreUtilsList::MoreUtilsshould have a suitable replacement for your in_array()in_array()function if you're interested or have it installed on all your systems. - If you're using a perlPerl version >= 5.10, you can replace in_array
in_arraywith the smart match oeprator ~~operator~~. - Don't let your exclude lists get too big as storing them in an array an iterating through them is an O(n) operation. A hash lookup may be faster for large lists and would de-dup for you automatically.
- Using &
&before calling a subsubis pretty much deprecated. Just call it directly. - The shebang line '/usr/bin/env perl'
/usr/bin/env perlis more portable than '/usr/bin/perl'/usr/bin/perl - You stat
statyour file $name$nameover and over for all your various tests. stat()stat()it once, save the results, then re-use those results for all your tests. Remember that all tests like -d, -l and -f are stat()stat()calls internally. Read up on the perl statPerlstatcall and all the fields to help determine how to re-create the -d, -l, and -f checks against the returned data.