in reply to Simple Array

This is best done with a hash during user entry. See How do I use a hash as a set? for more details, but basically:
while(<STDIN>){ push @array, $_; if($hash{$_}){ print "$_ was entered more than once\n"; } $hash{$_}++; }
If your hash is declared as a my() variable inside a block during entry, you can even have the memory freed when you leave the block.