This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix deparsing of undefined hint hash values
[perl5.git] / dist / B-Deparse / t / deparse.t
index 84f5f6a..7b11ccf 100644 (file)
@@ -789,3 +789,21 @@ my(@a) = ()[()];
 print sort(foo('bar'));
 >>>>
 print sort(foo('bar'));
+####
+# substr assignment
+substr(my $a, 0, 0) = (foo(), bar());
+$a++;
+####
+# hint hash
+BEGIN { $^H{'foo'} = undef; }
+{
+ BEGIN { $^H{'bar'} = undef; }
+ {
+  BEGIN { $^H{'baz'} = undef; }
+  {
+   print $_;
+  }
+  print $_;
+ }
+ print $_;
+}