The problem in when I run a small set of data this script works fine, but when I actually run it with the complete data of 2000 to compare with 83,000 then it doesn't work.

Then the problem is possibly in the way you are reading your data from the file and loading it into your internal data structures. It would be useful to see the code that reads the data from the files.

Just in case you might be worrying on that, 83,000 entries is a quite small dataset, I am almost certain you don't have problem with the data size, unless you do something very really weird, or unless you are running your program on a Sinclair ZX81 (aka Timex/Sinclair 1000), a Commodore 64 (64 kB RAM) or an Intel 8086 platform with 380 kB memory running on Dos 3.0, dating from 1983, but I very much doubt that Perl has ever been ported on such a box).

One additional point: I completely agree with Old Gray bear that hashes are fare more appropriate than arrays for the type of problems you want to solve.


In reply to Re: How to work with Arrays of 83,000 values by Laurent_R
in thread How to work with Arrays of 83,000 values by vaniaul

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.