in reply to Detecting duplicate entries
The hash solutions that have already been given have the right idea, but you can use hash slices to make it look a bit simpler.
--my %uniq; @uniq{@orig_list} = @orig_list; my @unique_list = keys %uniq;
"Perl makes the fun jobs fun
and the boring jobs bearable" - me
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Detecting duplicate entries
by japhy (Canon) on Mar 01, 2001 at 22:24 UTC | |
|
Re: Re: Detecting duplicate entries
by petral (Curate) on Mar 01, 2001 at 23:48 UTC | |
by japhy (Canon) on Mar 01, 2001 at 23:50 UTC | |
by petral (Curate) on Mar 02, 2001 at 01:43 UTC | |
|
Re: Re: Detecting duplicate entries
by merlyn (Sage) on Mar 01, 2001 at 22:11 UTC |