Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Re: Peer Review for Folder Delete Script
- A. Sinan Unur
January 25, 2009, 2:49 pm
rate this thread
File Name: directory_cleanup.pl
WARNING: This script can be very unforgiving and damaging. Make
sure the the correct path is listed, otherwise extreme data loss my
instead of # characters for long block comments like that. Also,
s/my occur/may occur/.
Better yet, write your comments in a proper POD.
How about having the user type in the path and confirm? (or, is this
script going to be periodically invoked by a scheduler?)
I recommend that you consider the option of putting configuration
variables in configuration files.
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
Re: Peer Review for Folder Delete Script
Caught it... but still thanks to your attention to detail :)
I probably should have started using POD years ago, but some of the biggest
complements I get are on my consistent and copious comments. Recently some
utility/support scripts I wrote over eight years ago to support a vendor
supplied application were being reviewed in a project to replace that
application. Even though I was somewhat embarrassed about my awkward coding
(it was much worse back then), I was very pleased with how everyone said my
comments made it very easy to understand why and what the scripts are
doing. On the other hand, I've always written the comments so I can easily
figure out what the heck I did.
This script will be scheduled to run once a week by the Windows scheduler.
While I would like to say this script is a case of "implement and
forget"... we all know that is not always the case.
In cases where I know the script will be used for multiple runs, I create
.conf files so the script can call them using @argv from the scheduler. In
this case, the script is being used to support a statement about why and
when the folders are removed. This script will provide the appropriate
amount of rigor without overkill.
- » FAQ 4.45 How do I find the first array element for which a condition is true?
- — Previous thread in » PERL Discussions