I think that you are being too kind to the original code. I figure that it is more than "fairly dodgy". The idea that the code could be reduced to only 2/3 of original size is a vast understatement!

This is a case where the general implementation approach of the code is just so far wrong, that telling the OP to study more won't help. The OP is trying to modify very poorly written code from another student.

"studying crap" is just going to result in "more crap".

I think this is case where showing some Monk level code is appropriate and I tried to do that. The OP has gotten some enormous hints about what to do.

I hope that the OP uses the code given and comes back with better questions.


In reply to Re^2: Redoing a script by Marshall
in thread Redoing a script by PhiThors

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.