On Fri, Aug 17, 2012 at 8:20 AM, Ed Avis <eda@waniasset.com> wrote: > > Good point. I was assuming that there is a concept of scalar equality defined > by the language and accessible to the programmer directly. But this is not the Perl gives you numeric and string equality (and allows overriding of each). Consider this: use v5.10; use strict; use warnings; use bignum; use Scalar::Util qw/refaddr/; my $x = 42; my $y = 42; say '$x is object at ' . refaddr($x); say '$y is object at ' . refaddr($y); # output: # $x is object at 40813776 # $y is object at 40814952 If you tested C<< $x in ( $y ) >>, is that true or false? $x and $y are different objects, yet the compare true numerically. Is $x in the list or not? Thus your conception of "in" is visually elegant -- and I like that -- but just isn't specific enough for the dynamic nature of Perl, whereas junctions force the programmer to clarify what comparison they actually want for a membership test. C<< $x == any( $y ) >> C<< refaddr($x) == any( map { refaddr $_ } $y ) >> -- DavidThread Previous | Thread Next