in reply to == works where it shouldn't but eq doesn't where it should

You've left out a lot of the problem, but it looks like you might want a hash instead of an array. In your example, it looks like you simply want to check if an element is in the array.

Once you have the hash, you can use exists to check if the key is there. You won't have to go through a bunch of other elements and you won't have to care about comparing elements. :)

my %ops = map { $_, 1 } @ops; # create the hash however you like my $op = exists $ops{$member} ? 1 : 0;

Alberto Simões talks more about this sort of thing in his article "Array Anti-Patterns" in the Fall 2005 issue of The Perl Review. :)

--
brian d foy <brian@stonehenge.com>
Subscribe to The Perl Review