How are you initially populating the hash? Surely, you are not just typing in all the hash values into the script to populate it. It would be at this point where I would be insuring that "duplicate" things don't ever make it into the hash. For instance if it were a just a comma delimited ascii file, I would probably have another hash that collects the information that needs to be unique,concatenate it all together into the second hashes keys, and then check against that before allowing the data to be placed in the initial %students hash. I would do something similar if it were coming from a database, or another source.

If you give us an idea of how the hash is initially populated, I think some monk will be better able to answer your question. Otherwise you can just take all the hash values and compare them against each other for each student and delete the ones that match exactly.

-enlil


In reply to Re: delete duplicate hash value's by Enlil
in thread delete duplicate hash value's by juo

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.