> On 14 Jun 2016, at 06:27, Zefram (via RT) <[email protected]> 
> wrote:
> 
> # New Ticket Created by  Zefram 
> # Please include the string:  [perl #128399]
> # in the subject line of all future correspondence about this issue. 
> # <URL: https://rt.perl.org/Ticket/Display.html?id=128399 >
> 
> 
>> my @a = 22,33
> [22 33]
>> @a[0]
> 22
>> @a[1]
> 33
>> @a[0].VAR.WHICH
> Scalar|100414504
>> @a[1].VAR.WHICH
> Scalar|100414504
>> @a[0].VAR === @a[1].VAR
> True
> 
> Behaviourally the two scalar objects are clearly distinct, as they
> should be.  .WHICH errs in advertising the same identity for both, and ===
> follows suit in saying that they are identical.  All scalar containers
> created for a single array get this treatment, even ones created later
> by pushing more elements onto the array.  Scalars created separately,
> for other arrays or for standalone scalar variables, correctly get
> different identities shown by .WHICH.

ENOTABUG

.VAR reveals the properties of the underlying container of the object it is 
used on.  For an array, this *IS* the same for each element.  The same applies 
to hashes:


$ 6 'my %h = a => 42, b => 666; say %h<a>.VAR === %h<b>.VAR’
True


Liz

Reply via email to