Skip to main content
added 30 characters in body
Source Link
toolic
  • 16.8k
  • 6
  • 30
  • 224

Overall it looks clean and simple. Good job. Here are some things I noticed:

  1. You should use "use warnings"use warnings for production level code. ItsIt's odd that you use strictstrict but not warningswarnings.
  2. List::UtilList::Util or List::MoreUtilsList::MoreUtils should have a suitable replacement for your in_array()in_array() function if you're interested or have it installed on all your systems.
  3. If you're using a perlPerl version >= 5.10, you can replace in_arrayin_array with the smart match oeprator ~~operator ~~.
  4. 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.
  5. Using && before calling a subsub is pretty much deprecated. Just call it directly.
  6. The shebang line '/usr/bin/env perl'/usr/bin/env perl is more portable than '/usr/bin/perl'/usr/bin/perl
  7. You statstat your file $name$name over 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 statPerl stat call and all the fields to help determine how to re-create the -d, -l, and -f checks against the returned data.

Overall it looks clean and simple. Good job. Here are some things I noticed:

  1. You should use "use warnings" for production level code. Its odd that you use strict but not warnings.
  2. List::Util or List::MoreUtils should have a suitable replacement for your in_array() function if you're interested or have it installed on all your systems.
  3. If you're using a perl version >= 5.10 you can replace in_array with the smart match oeprator ~~.
  4. 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.
  5. Using & before calling a sub is pretty much deprecated. Just call it directly.
  6. The shebang line '/usr/bin/env perl' is more portable than '/usr/bin/perl'
  7. You stat your file $name over and over for all your various tests. 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() calls internally. Read up on the perl stat call and all the fields to help determine how to re-create the -d, -l, and -f checks against the returned data.

Overall it looks clean and simple. Good job. Here are some things I noticed:

  1. You should use use warnings for production level code. It's odd that you use strict but not warnings.
  2. List::Util or List::MoreUtils should have a suitable replacement for your in_array() function if you're interested or have it installed on all your systems.
  3. If you're using a Perl version >= 5.10, you can replace in_array with the smart match operator ~~.
  4. 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.
  5. Using & before calling a sub is pretty much deprecated. Just call it directly.
  6. The shebang line /usr/bin/env perl is more portable than /usr/bin/perl
  7. You stat your file $name over and over for all your various tests. 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() calls internally. Read up on the Perl stat call and all the fields to help determine how to re-create the -d, -l, and -f checks against the returned data.
added #7
Source Link
bot403
  • 176
  • 2

Overall it looks clean and simple. Good job. Here are some things I noticed:

  1. You should use "use warnings" for production level code. Its odd that you use strict but not warnings.
  2. List::Util or List::MoreUtils should have a suitable replacement for your in_array() function if you're interested or have it installed on all your systems.
  3. If you're using a perl version >= 5.10 you can replace in_array with the smart match oeprator ~~.
  4. 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.
  5. Using & before calling a sub is pretty much deprecated. Just call it directly.
  6. The shebang line '/usr/bin/env perl' is more portable than '/usr/bin/perl'
  7. You stat your file $name over and over for all your various tests. 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() calls internally. Read up on the perl stat call and all the fields to help determine how to re-create the -d, -l, and -f checks against the returned data.

Overall it looks clean and simple. Good job. Here are some things I noticed:

  1. You should use "use warnings" for production level code. Its odd that you use strict but not warnings.
  2. List::Util or List::MoreUtils should have a suitable replacement for your in_array() function if you're interested or have it installed on all your systems.
  3. If you're using a perl version >= 5.10 you can replace in_array with the smart match oeprator ~~.
  4. 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.
  5. Using & before calling a sub is pretty much deprecated. Just call it directly.
  6. The shebang line '/usr/bin/env perl' is more portable than '/usr/bin/perl'

Overall it looks clean and simple. Good job. Here are some things I noticed:

  1. You should use "use warnings" for production level code. Its odd that you use strict but not warnings.
  2. List::Util or List::MoreUtils should have a suitable replacement for your in_array() function if you're interested or have it installed on all your systems.
  3. If you're using a perl version >= 5.10 you can replace in_array with the smart match oeprator ~~.
  4. 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.
  5. Using & before calling a sub is pretty much deprecated. Just call it directly.
  6. The shebang line '/usr/bin/env perl' is more portable than '/usr/bin/perl'
  7. You stat your file $name over and over for all your various tests. 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() calls internally. Read up on the perl stat call and all the fields to help determine how to re-create the -d, -l, and -f checks against the returned data.
Source Link
bot403
  • 176
  • 2

Overall it looks clean and simple. Good job. Here are some things I noticed:

  1. You should use "use warnings" for production level code. Its odd that you use strict but not warnings.
  2. List::Util or List::MoreUtils should have a suitable replacement for your in_array() function if you're interested or have it installed on all your systems.
  3. If you're using a perl version >= 5.10 you can replace in_array with the smart match oeprator ~~.
  4. 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.
  5. Using & before calling a sub is pretty much deprecated. Just call it directly.
  6. The shebang line '/usr/bin/env perl' is more portable than '/usr/bin/perl'