On Jun 5, Jamie Krasnoo said:
>From: Peter Scott [mailto:[EMAIL PROTECTED]]
>>
>>{ my %temp;
>> @temp{@array} = ();
>> @youwant = keys %temp;
>>}
>>
>>However, that said, 99 times out of a hundred you should have been keeping
>>your data in a hash to begin with and you've made a design error
al Message-
From: Peter Scott [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 05, 2001 6:11 PM
To: Philip Peeters; [EMAIL PROTECTED]
Subject: Re: Perl: Finding unique strings in an array
At 06:02 PM 6/5/2001 -0700, Philip Peeters wrote:
>Hi,
>
>Is there some magical way to identify u
At 06:02 PM 6/5/2001 -0700, Philip Peeters wrote:
>Hi,
>
>Is there some magical way to identify unique strings within an array?
>
>
>Example:
>@array = ( "beer","water","wine","beer","wine");
>and I'd like to end up with: beer, water, wine
{ my %temp;
@temp{@array} = ();
@youwant = keys %t
Ok, the simplest way i see is inserting the elements into a hash as keys,
thus eliminating duplicates, and then do keys on the hash.
-Original Message-
From: Philip Peeters [mailto:[EMAIL PROTECTED]]
Sent: 05 e?iy 2001 a. 21:03
To: [EMAIL PROTECTED]
Subject: Perl: Finding unique strings
Hi,
Is there some magical way to identify unique strings within an array?
Example:
@array = ( "beer","water","wine","beer","wine");
and I'd like to end up with: beer, water, wine
If there is some kind of function that does this, then I'd be most glad
to hear of it. If not, I'll figure somethi