in reply to Perl script commenting assistant

Wafel,
I didn't get a chance to review much of your code, but I did see something right at the top that really bothered me. By default, you wipe out the original file prior to completion of the program. If the user aborts the script prematurely or it receives a signal to terminate - their code is mangled.

As a general piece of advice, you should code as much for input you don't expect as you do for what you do expect. Some people intentionally try to mess things up and other times you are just dealing with "dumb" users. I quoted dumb as it is relative. You know what your code is supposed to do since you wrote it.

Again, I was busy with other things and didn't get a chance to look at what you have here, but wanted to point this one thing out to you. I am sure someone would be quite upset if they lost their code because they were trying to comment it using your script.

Cheers - L~R

Replies are listed 'Best First'.
Re: Re: Perl script commenting assistant
by Wafel (Novice) on Jul 07, 2003 at 09:33 UTC
    You're right of course, guess that's the problem with offering code you wrote for your own use only. It now buffers output first, thanks for the feedback