[perl #113712] Don’t create stubs after errors
perl5.002beta3 (
c07a80fdfe) stopped bodies of subrou-
tines from being defined after compilation errors, as in
eval "@a =~ s///; sub { die }".
But, instead of making the sub declaration not happen at all, it ended
up leaving a stub.
For a full sub declaration (body and all) to create a stub just
seems wrong.
Likewise, it would be weird if a stub declaration
after a compilation error created a stub, because then
eval "@a =~ s///; sub foo; sub bar { }" would create foo but not bar.
Similarly, a compilation error will cause ‘sub foo {}’ no suppress
‘used once’ warnings; but a lexing error won’t.
This commit fixes all this, making things consistent: If there is a
compilation, parsing or lexing error, any kind of sub declaration that
follows is ignored.