sub member(&@$) { my ($eq, $array, $item) = @_; for (@$array) { return 1 if $eq->($_, $item) } return undef; }