[EMAIL PROTECTED] wrote:
> Though about using a hash but I don't have a need for a Key/Value
> combination. I just need a list without duplicates. I suppose I can
> define the hash keys if they don't already exists and export the keys
> into an array with the keys function. Is that what you are hinting
> towards? 

Yes, that's what I'm hinting at :~)

A hash would be called for if you need to do repeated tests to see whether
an element exists in the set. The downside to pulling the unique values with
keys() is that you lose the original order, if that matters.

Tie::Array::Unique will take care of the problem and preserve the order,
while letting you push entries onto the array without worrying about
creating duplicates.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to