Sorry if I misunderstood the orginal post.
From the orginal post, if count is less than 998 value will be added to @store_get_dist1, @store_get_dist2 and @store_get_dist3.
If the count is less than 1998 and greater than or equal to 998, the value will be addded to both @store_get_dist2 and @store_get_dist3.
At the time when the count is 1998, there should be 997 elements in @store_get_dist1 and 1997 elements in @store_get_dist2.
In your array of array implementation, When I add
print scalar(@{$store_get_dist[1]});
it prints 997 and prints 1000 for index 2. Not sure if this is the expected behaviour.
It should have been 997 and 1997 respectively. Am I missing anything?

Update:
From
push(@{$store_get_dist[$test_num]},$new);
to
for ($test_num.. int((($#all_stores+3)/1000)+1)) { #3 to account for 998 1998 and 2998 push(@{$store_get_dist[$_]},$new); }
and it should work. A quick dirty hack though.

In reply to Re^2: adding number to array name by Mandrake
in thread adding number to array name by Anonymous Monk

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.