It just seems that if I have a huge array of filenames and directories, and I want to compare another huge list of filenames and directories, it takes a long time with an array. Say for instance if I have a list of 2000 elements, and I want to compare that to another array that is 2000 elements, thats 4,000,000 iterations thru loops. Would hashes not be better for such a look up method? Maybe I am just putting to much emphasis on it, and the way I did it before is fine.

There is still a good bit that I do not understand about hashes and seeing 10 different way on how to build them kind of confuse me. ;) But the code I posted above, why is it adding $file to both keys and values of the hash?

Thanks for commenting btw :)

In reply to Re^2: Trying to understand hashes (in general) by james28909
in thread Trying to understand hashes (in general) by james28909

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.