Timo Paulssen via RT wrote:
>However, in one of your examples you're actually getting a Scalar inside 
>a Scalar. Check this out:

Huh, there is indeed a difference there that I wasn't aware of.  Thanks.
Can also be seen by:

> sub tt0(Scalar $s) { say $s.WHAT; }
sub tt0 (Scalar $s) { #`(Sub|69930648) ... }
> sub tt1($s) { say $s.WHAT; }
sub tt1 ($s) { #`(Sub|69930800) ... }
> my $a = 3
3
> tt0($a.VAR)
(Int)
> tt1($a.VAR)
(Scalar)
> 

In this respect, tt1() is behaving the way I expect, and tt0() looks like
a bug.  The sub is receiving, as the apparent value of the parameter,
the value contained in what the caller thought it was sending as the
parameter value.  So what I'd perceived as useful behaviour of := seems
to be a bug in parameter handling.

This issue has some slight resemblance to [perl #128409] and [perl
#128407], but probably isn't the same bug as either.

Is there some way I missed to get access to the content of a Scalar?
Something other than exploiting this bug?  That's what I was originally
after when I ran into this.

-zefram

Reply via email to