in reply to Determining if an element is already in an array.

No need for a loop. Try this:

my %check; @check{@arr) = (1) x @arr;

You now have a hash %check which has a key/value pair for each element in the list. You can check for the existance of value, $val, by doing:

if $check{$val}