Ed Avis <eda <at> waniasset.com> writes:
>>>but I suggest an explicit entry in the 'Smart matching in detail' section
>>>to document the case when $a is an array and $b is a string, which is
>>>currently missing.
>But I don't see that 'string equality' is the semantics?
>
> % perl -E '@a = (1, 2, 3); $s = "@a"; say(@a ~~ $s)'
Ah, in fact it appears to be 'reference equality':
% perl -E '@a = (1, 2, 3); $s = \@a; say(@a ~~ $s)'
1
I really don't think the documentation is clear on this point. Should I
submit a patch against perlsyn?
--
Ed Avis <eda@waniasset.com>
Thread Previous
|
Thread Next