in reply to Re: (jeffa) Re: Removing Duplicates in an array?
in thread Removing Duplicates in an array?
At 2818 chars, I golf:
/me wonders how soon MeowChow will have a shorter solution...sub u{@h{@_}=@_;keys%h} print join "\t", u("fish","bread","eggs","eggs","fish","butter") #butter bread fish eggs
Jeroen
"We are not alone"(FZ)
Update: Too bad. The shortest I can come with
is just a rewrite
of Davorg's code (he's a golfer in disguise):
sub u{$h{$_}++for@_;grep$h{$_}<2,keys%h}
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re:{3} Removing Duplicates in an array?
by Tiefling (Monk) on Jun 26, 2001 at 20:11 UTC | |
Re: Re:{3} Removing Duplicates in an array?
by MeowChow (Vicar) on Jun 27, 2001 at 11:16 UTC |
In Section
Seekers of Perl Wisdom