Fix subroutine unavailability during cloning
sub foo {
my $x;
format =
@
$x||'#'
.
}
write;
__END__
Variable "$x" is not available at - line 9.
That one’s OK.
sub foo {
my sub x {};
format =
@
&x
.
}
write;
__END__
Variable "&x" is not available at - line 9.
Assertion failed: (SvTYPE(_svmagic) >= SVt_PVMG), function S_mg_findext_flags, file mg.c, line 404.
Abort trap
That should say ‘Subroutine’. And it shouldn’t crash.
The my-sub-cloning code was not taking this case into account. The
value in the proto pad is an undef scalar.