+ our $X = 1;
+ is $X, 1;
+ {
+ temp $X = 2;
+ is $X, 2;
+ $X = 3;
+ is $X, 3;
+ }
+ is $X, 1;
+ {
+ temp $X = 4;
+ is $X, 4;
+ temp $X = 5;
+ is $X, 5;
+ }
+ is $X, 1;
+ {
+ temp $X;
+ is $X, undef;
+ }
+ is $X, 1;
+ {
+ local $X = 6;
+ is $X, 6;
+ }
+ is $X, 1;
+ {
+ local $X = 7;
+ temp $X = 8;
+ is $X, 8;
+ }
+ is $X, 1;
+ {
+ temp $X = 9;
+ local $X = 10;
+ is $X, 10;
+ }
+ is $X, 1;
+}
+
+{
+ our @Y = (1, 2);
+ is "@Y", "1 2";
+ {
+ temp @Y = [ 3 ];
+ is "@Y", '3';
+ @Y = (4, 5, 6);
+ is "@Y", '4 5 6';
+ $Y[3] = 7;
+ is "@Y", '4 5 6 7';
+ }
+ is "@Y", "1 2";
+ {
+ temp @Y = [ 8, 9, 10 ];
+ is "@Y", '8 9 10';
+ $Y[1] = 11;
+ is "@Y", '8 11 10';
+ }
+ is "@Y", "1 2";
+ {
+ temp @Y = [ 12, 13, 14 ];
+ is "@Y", '12 13 14';
+ temp @Y = [ 15, 16];
+ is "@Y", '15 16';
+ }
+ is "@Y", '1 2';
+ {
+ temp @Y;
+ is "@Y", '';
+ }
+ is "@Y", '1 2';
+ {
+ temp @Y = [ qw<a b c> ];
+ is "@Y", 'a b c';
+ SKIP: {
+ skip $aelem_delete_msg => 3 unless $aelem_delete_ok;
+ local $Y[1] = 'd';
+ is "@Y", 'a d c';
+ {
+ local @Y[2, 3] = qw<e f>;
+ is "@Y", 'a d e f';
+ }
+ is "@Y", 'a d c';
+ }
+ is "@Y", 'a b c';
+ }
+ is "@Y", '1 2';
+ {
+ local @Y = qw<A B>;
+ is "@Y", 'A B';
+ }
+ is "@Y", '1 2';
+ {
+ local @Y = qw<C D E>;
+ temp @Y = [ qw<F> ];
+ is "@Y", 'F';
+ }
+ is "@Y", '1 2';
+ {
+ temp @Y = [ qw<G H I> ];
+ local @Y = qw<J>;
+ is "@Y", 'J';
+ }
+ is "@Y", '1 2';
+}
+
+{
+ our %Z = (a => 1);
+ is describe(\%Z), 'a:1';
+ {
+ temp %Z = { b => 2 };
+ is describe(\%Z), 'b:2';
+ %Z = (c => 3);
+ is describe(\%Z), 'c:3';
+ $Z{d} = 4;
+ is describe(\%Z), 'c:3, d:4';
+ }
+ is describe(\%Z), 'a:1';
+ {
+ temp %Z = { a => 5 };
+ is describe(\%Z), 'a:5';
+ $Z{a} = 6;
+ is describe(\%Z), 'a:6';
+ }
+ is describe(\%Z), 'a:1';
+ {
+ temp %Z = { a => 7, d => 8 };
+ is describe(\%Z), 'a:7, d:8';
+ temp %Z = { d => 9, e => 10 };
+ is describe(\%Z), 'd:9, e:10';
+ }
+ is describe(\%Z), 'a:1';
+ {
+ temp %Z;
+ is describe(\%Z), '';
+ }
+ is describe(\%Z), 'a:1';
+ {
+ temp %Z = { a => 11, f => 12 };
+ is describe(\%Z), 'a:11, f:12';
+ {
+ local $Z{a} = 13;
+ is describe(\%Z), 'a:13, f:12';
+ {
+ local @Z{qw<f g>} = (14, 15);
+ is describe(\%Z), 'a:13, f:14, g:15';
+ }
+ is describe(\%Z), 'a:13, f:12';
+ }
+ is describe(\%Z), 'a:11, f:12';
+ }
+ is describe(\%Z), 'a:1';
+ {
+ local %Z = (A => 1, B => 2);
+ is describe(\%Z), 'A:1, B:2';
+ }
+ is describe(\%Z), 'a:1';
+ {
+ local %Z = (A => 3, C => 4);
+ temp %Z = { A => 5, D => 6 };
+ is describe(\%Z), 'A:5, D:6';
+ }
+ is describe(\%Z), 'a:1';
+ {
+ temp %Z = { A => 7, E => 8 };
+ local %Z = (A => 9, F => 10);
+ is describe(\%Z), 'A:9, F:10';
+ }
+ is describe(\%Z), 'a:1';