The code may work as is, but as has already been pointed out in the thread there are some potential security issues as well. I'd think that alone would be enough to convince someone to rewrite the code sections in question.

In addition, there is definitely a place for rewriting code that has bad style -- if you have the time to do so. For example, there used to be a programmer here who wrote scripts in Perl that look like entries into an obfu contest. They're valid Perl, and they do what was asked. But management has decided that a lot of these scripts need to be updated for maintainability. Not to mention that some of the scripts needed minor changes that took weeks to implement due to coding style.

You don't have to point at anyone and say "Your style sucks! You should never write another program!". You can easily do this without personal attacks, which is what I think you mean by not being blunt. So since you've already made that point I won't reiterate it. :)


In reply to Re: Re: Bad Practice by Nkuvu
in thread Bad Practice by mkirank

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.