summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-09-25 08:19:13 -0700
committerFather Chrysostomos <sprout@cpan.org>2014-10-10 21:56:35 -0700
commitc146a62a4cab49a74d6cee4acf18e3ec9b40ee60 (patch)
tree24bcd3deeff2392e103f8baa58655d1312c3a6aa /t
parentb7ae253e76cba86199de07716b73ab1238d0b134 (diff)
downloadperl-c146a62a4cab49a74d6cee4acf18e3ec9b40ee60.tar.gz
List assignment to lexical scalar refs
\($x,$y)=... does not work yet, but \(my $x) and (\$x, \$y) do.
Diffstat (limited to 't')
-rw-r--r--t/op/lvref.t16
1 files changed, 9 insertions, 7 deletions
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';