First of all, let me say how happy I am to see somebody else combining two of my favorite subjects. :-)

More helpfully... I'm suprised nobody's mentioned this yet, but looking at the history of this quest, I don't think anybody has (my apologies if I missed it): use CGI.pm! It will simplify your life. (Better yet, use CGI.pm and use stylesheets to get those color codes out of your HTML--but that's my personal ideology speaking, and off-topic.)

use CGI qw(:all -nodebug);
will get you all the functions you need. It looks like you might have enough time invested in this already that it's not worth going back and changing everything now, but if you start another project like this one, give it a look.

But on the particular problem you're having right now, I'm not sure what to say, so I'll degenerate into nitpicks a little bit: if you comment the code, and use descriptive variable names, it will be easier for poor sods like us to figure out, and we'll be more helpful. And everything that arturo said is most wise and to be heeded (as usual).

Astanley's remarks are also very wise with the exception that he spaced which language he was in--the keyword in question is last, not continue. ;-)



If God had meant us to fly, he would *never* have give us the railroads.
    --Michael Flanders


In reply to Re: Running a Sub for a Text File by ChemBoy
in thread Running a Sub for a Text File by Perl Newby

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.