Front page | perl.beginners |
Postings from February 2002
unique elements in array
Thread Next
From:
Simon K. Chan
Date:
February 26, 2002 07:58
Subject:
unique elements in array
Message ID:
20020226155817.88007.qmail@web11901.mail.yahoo.com
Hi All,
The solution to my question is probably dead easy, but the bioperl module I'm working on right now
has sucked up all by brain juice! ;-)
Let's say I have this array:
@food = qw(milk ham eggs bread eggs milk);
How can I write a script that sticks all UNIQUE elements (occurs only once) into another array?
So, in the above case, @another_array would receive "ham" and "bread"
Many thanks for your time, Everybody!
=====
#########################################
Warmest Regards,
Simon K. Chan - perl_programmer2001@yahoo.com
"Great spirits have always encountered violent opposition from mediocre minds." - Albert Einstein
__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com
Thread Next
-
unique elements in array
by Simon K. Chan