Perhaps if you showed your code, we might be of more service...

The only thing I can think of without your example source is a little something that irked me when I first started...

Variables in Perl are, by default, "global" in a sense. In other languages, the scope of a variable is, by default, local to the subroutine or class or whatever is using the variable....

So, if you don't re-initialize a variable each time a subroutine fires, it might still have residual values from a previous iteration of the subroutine, thus you get unpredictable array results, etceteras.

That's about all I can offer, without seeing your code...

--higle

In reply to Re: Maintain a certain number of elements inside an array? by higle
in thread Maintain a certain number of elements inside an array? by drewboy

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.