10 no warnings 'deprecated';
14 # previous line intentionally left blank.
20 # previous line intentionally left blank.
27 my %foo = (aap => "monkey");
29 is("@{[$foo{'aap'}]}", 'monkey', 'interpolation of hash lookup with space between lexical variable and subscript');
30 is("@{[$foo {'aap'}]}", 'monkey', 'interpolation of hash lookup with space between lexical variable and subscript - test for [perl #70091]');
32 # Original bug report [perl #70091]
37 # (my $tmp = $foo) =~ s/^/$foo {$0}/e;
40 # This program causes a segfault with 5.10.0 and 5.10.1.
42 # The space between '$foo' and '{' is essential, which is why piping
43 # it through perl -MO=Deparse "fixes" it.
49 'BEGIN{ ++$_ for @INC{"charnames.pm","_charnames.pm"} } "\N{a}"',
50 'Constant(\N{a}) unknown at - line 1, within string' . "\n"
51 ."Execution of - aborted due to compilation errors.\n",
53 'correct output (and no crash) when charnames cannot load for \N{...}'
56 'BEGIN{ ++$_ for @INC{"charnames.pm","_charnames.pm"};
57 $^H{charnames} = "foo" } "\N{a}"',
58 "Undefined subroutine &main::foo called at - line 2.\n"
59 ."Propagated at - line 2, within string\n"
60 ."Execution of - aborted due to compilation errors.\n",
62 'no crash when charnames cannot load and %^H holds string'
65 'BEGIN{ ++$_ for @INC{"charnames.pm","_charnames.pm"};
66 $^H{charnames} = \"foo" } "\N{a}"',
67 "Not a CODE reference at - line 2.\n"
68 ."Propagated at - line 2, within string\n"
69 ."Execution of - aborted due to compilation errors.\n",
71 'no crash when charnames cannot load and %^H holds string reference'