# New Ticket Created by Zefram
# Please include the string: [perl #128406]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=128406 >
Calling .perl on a Scalar container object produces output that represents
neither the container nor the contained value, but seems to arise from
a mixture of both:
> sub scalar-make(Mu $iv) { my $v = $iv; $v.VAR }
sub scalar-make (Mu $iv) { #`(Sub|92435288) ... }
> my $x = scalar-make(22)
22
> $x.WHAT.say
(Scalar)
> $x.perl
Int.new
> $x.perl.EVAL.WHAT.say
(Int)
> $x.perl.EVAL
0
Scalar.perl ought to yield a constructor expression for a Scalar object,
including as a subexpression the .perl of the contained value. In the
above, $x.perl should be the moral equivalent of "scalar-make(22)", though
obviously it shouldn't refer to this user-defined function, and it should
include the other attributes of the Scalar such as its .name ('$v').
-zefram