The original sample was:
BEGIN {
$^H |= 0x00000400; # strict vars
}
# Undeclared variable here
sub foo { return $anyvar; }
# Any CORE:: here
sub bar { \&CORE::lc }
simplified to:
BEGIN {
$^H |= 0x00000400; # strict vars
}
$anyvar;
&CORE::lc;
but it occurs for any compile-time error that doesn't abort compilation,
such as:
$foo/; \&CORE::lc
is runperl(prog => '@ISA=CORE; print main->uc, qq-\n-'), "MAIN\n",
'inherted method calls autovivify coresubs';
+{ # RT #117607
+ local $TODO = "\\&CORE::lc crashes in error context";
+ $tests++;
+ like runperl(prog => '$foo/; \&CORE::lc', stderr => 1),
+ qr/^syntax error/, "RT #117607: \\&CORE::foo doesn't crash in error context";
+}
+
$tests++;
ok eval { *CORE::exit = \42 },
'[rt.cpan.org #74289] *CORE::foo is not accidentally made read-only';