mirod's answer is well explained, and
Hofmator and
mugwumpjism (what a beaut of a name) have shown how Perl can make something very... um.. concise.
I noticed that you are a novice monk and therefor might not be aware of the great deal of information that is available for you via the Search box at the top of your screen while on PerlMonks. Typing the words "unique elements" in the box returned many articles that contain a great deal of information related to your question.
One of the benefits of using the search would be that you would not have to wait for an answer to your question, it is already there. You might also find out quite a bit more that you had originally asked.
Good luck, welcome, and don't forget the Search box.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.