On Aug 2, Jeff 'japhy/Marillion' Pinyan said:

>On Aug 2, Charles Lu said:
>
>>@list = (1,2,3,4,2,67,4,4,9);
>>
>>I want to remove all the redundant ones so the final list should
>>contain (1,2,3,4,67,9).   Although I have implemented my own way of doing 
>>it, I think this problem is quite common and therefore someone must have 
>>written a function for it.  Can anyone suggest a module/builtin function  
>>that takes a number and checks to see it that number already exists in an 
>>array?  basically a "is_in()" function that returns true or false.
>
>The key is not to use a hash to do the checking.

Err, the key is not to use an ARRAY to do the checking, but to use a hash
instead, as the FAQ suggests.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to