You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(sub () { my $a = 22; my $b = $a.VAR; $b.WHAT.say; $b })().WHAT.say
(Scalar)
(Int)
$b is a Scalar, and the subroutine attempts to return it. The caller
doesn't receive it; instead it receives the Int that was contained in
the Scalar. This happens specifically when the sub has the Scalar in
a variable and the return expression is a reference to that variable.
If the return expression is "$a.VAR", then the caller receives the Scalar
as expected.
Migrated from rt.perl.org#128409 (status was 'new')
Searchable as RT128409$
The text was updated successfully, but these errors were encountered: