Not a full answer to your problems... but a start: At line 7 (and numerous other spots), you comment out "use strict;" and/or "use warnings;"

That's a mistake.

strict will tell you when and where (or pretty close) you've made typos (such as using two different spellings for a single $var) and the like. Keep "use strict" (and "use warnings") in ALL your code until you know precisely why you should omit it.

OTOH, you're probably right about deleting "use 5.008" unless you are using a very old version of Perl. Current is 5.16 (or 5.14 if your vendor hasn't caught up).

Now, some WAGs, as I find your problem statement and code confusing (or maybe because it's pre-caffeine of a Sunday am):

Re your while problem: perhaps using an equality test rather than an assignment would be worth considering?

And, "return where?" -- looks to me like an exit from the package to return to your main.

Thank goodness, the kettle's whistling.


In reply to Re: Wx Server reform by ww
in thread Wx Server reform by gg4000

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.