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


In reply to Re: Perl script commenting assistant by Limbic~Region
in thread Perl script commenting assistant by Wafel

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.