* Aaron Priven <aaron@priven.com> [2012-07-06T02:15:24] > sub in { > my $member = shift; > for (@_) { > return 1 if $member eq $_; > } > return q{}; > } > > > Except for the use of "eq", it doesn't assume anything about the type of > anything. And inferring numeric / string from the operator is what, I > thought, Perl did. Hence the suggestion of a numeric "in" operator. > > That's not to say it's necessarily worth doing. Maybe, as Aaron Crane > suggests, it's not "powerful enough to justify its own existence." The use of "eq" is the primary type issue. If we need a numeric in, then now we're talking about *two* operators to justify, each with one very specific use. On the other hand, you can use any() with all sorts of comparitors and values. -- rjbsThread Previous | Thread Next