in reply to Adding Unique Elements to Array
push(@array,$foo) unless (grep /$foo/,@array); [download]
/$foo/ isn't equivalent to $_ eq $foo. Personally I use $_ eq $foo quite often, as I see no benefit in using /^\Q$foo\E\z/.
You might want to look at first from List::Util.
ihb
See perltoc if you don't know which perldoc to read!