469,303 Members | 1,796 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,303 developers. It's quick & easy.

unique elements (case insentitive) of an array in perl

jjl
I have an array, and try to find out the unique elements (case insentitive)
of array. Could someone help me out. Thanks a lot.
Jul 19 '05 #1
2 5938
jjl wrote:
I have an array, and try to find out the unique elements (case
insentitive) of array. Could someone help me out. Thanks a lot.


Please see "perldoc -q duplicate":
"How can I remove duplicate elements from a list or array?"

If you want case-insensitive then just define your own normal form, all
lower case of all upper case usually is the easiest.

jue
Jul 19 '05 #2
> I have an array, and try to find out the unique elements (case insentitive)
of array. Could someone help me out. Thanks a lot.


Put you elements into hash (using array elemet as a hash key) and before
putting it call uc() or lc(). When it is done, (keys %hash) will be
the desired array.

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Matthew Sims | last post: by
2 posts views Thread by kevin parks | last post: by
24 posts views Thread by superprad | last post: by
9 posts views Thread by Rolf Kemper | last post: by
8 posts views Thread by nescio | last post: by
5 posts views Thread by Paulers | last post: by
9 posts views Thread by Brian Tkatch | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.