> How about just:
>
> @list = (qw(two one none zero seven two zero))
Here's a shorter easier way to do your example:
@list = qw(two one none zero seven two zero);
>
> foreach my $elem ( @list ) {
> $list{$elem}++;
> }
for(@list) { $list{$_}++; }
>
> @list = ();
>
> foreach my $key ( keys %list ) {
> push(@list,$key);
> }
@list = (keys %list);
>
> To explain:
> Each non-unique element in the list will simply increment
> the unique hash key, then read back all the hash keys into your list.
Although why not just do it all in one line?
@list = do { my %t;grep !$t{$_}++, @list };
HTHIKIDM
(FYI of rll those followint the HTH thread - This is Hope [This|That] Helps I
Know It Did Me
Coined by Me today July 24, 2003)
DMuey
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]