From c146a62a4cab49a74d6cee4acf18e3ec9b40ee60 Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Thu, 25 Sep 2014 08:19:13 -0700 Subject: List assignment to lexical scalar refs \($x,$y)=... does not work yet, but \(my $x) and (\$x, \$y) do. --- t/op/lvref.t | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 't') diff --git a/t/op/lvref.t b/t/op/lvref.t index ef1a6c2b27..be97fb489a 100644 --- a/t/op/lvref.t +++ b/t/op/lvref.t @@ -49,25 +49,27 @@ is \$x, \$_, '\($pkgvar) = ... gives list context'; undef *x; (\$x) = @_; is \$x, \$_, '(\$pkgvar) = ... gives list context'; -on; my $o; -eval '\($o) = @_'; +\($o) = @_; is \$o, \$_, '\($lexical) = ... gives list cx'; my $q; -eval '(\$q) = @_'; +(\$q) = @_; is \$q, \$_, '(\$lexical) = ... gives list cx'; -eval '\(my $p) = @_'; +\(my $p) = @_; is \$p, \$_, '\(my $lexical) = ... gives list cx'; -eval '(\my $r) = @_'; +(\my $r) = @_; is \$r, \$_, '(\my $lexical) = ... gives list cx'; -eval '\my($s) = @_'; +\my($s) = @_; is \$s, \$_, '\my($lexical) = ... gives list cx'; +on; eval '\($_a, my $a) = @{[\$b, \$c]}'; is \$_a, \$b, 'package scalar in \(...)'; is \$a, \$c, 'lex scalar in \(...)'; -eval '(\$_b, \my $b) = @{[\$b, \$c]}'; +off; +(\$_b, \my $b) = @{[\$b, \$c]}; is \$_b, \$::b, 'package scalar in (\$foo, \$bar)'; is \$b, \$c, 'lex scalar in (\$foo, \$bar)'; +on; is eval '\local $l = \3; $l', 3, '\local $scalar assignment'; off; is $l, undef, 'localisation unwound'; -- cgit v1.2.1