in reply to Pushing unique items onto an array
Try "exists".
my @fruit = ('apple', 'pear', 'lemon', 'celery', 'pear'); my %seen = (); foreach (@fruit) { $seen{$_} = 1 if not exists $seen{$_}; } my @unique = keys %seen;
.oO(exists $fruit{'celery'}?)
Cē
|
|---|