in reply to remove duplicate value in array
Fletch and Nevtlathiel have it above. Just in case the code sample is too dense, here's a little "looser" version that does the same thing:
So %seen is the hash that gets a key for each unique value in @content, and @unique is an array containing those (unique) keys.my %seen; $seen{$_}++ for @content; my @unique = keys %seen;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: remove duplicate value in array
by ptum (Priest) on Jul 11, 2006 at 14:45 UTC | |
Re^2: remove duplicate value in array
by ikegami (Patriarch) on Jul 11, 2006 at 22:01 UTC |
In Section
Seekers of Perl Wisdom