There is a lot of fairly dodgy code in there. Nothing really terrible, but lots of sloppy coding like several subs where the only difference is in variable names, or the use of prototype subs that would cause the code to fail except that the subs are defined after their first use so the prototypes are ignored (it's not important that you understand what that means btw). To be fair there is some good code there too, but it would be hard for a newbie to pick what is good and what is bad. With a good tidy up I'd expect that code to reduce to about 2/3 of its current size and to become easier to understand too.

If you have the option I'd suggest you start from scratch for the new project and come back to PerlMonks to ask questions when you get stuck. You aren't going to learn a lot that is good working from the code you have shown us. Unless someone provides a complete solution for you, it'll probably be quicker to dump this code and start over for the new task. If you do, please come back to have it critiqued so we can help you learn appropriate Perl coding habits.

True laziness is hard work

In reply to Re: Redoing a script by GrandFather
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.