in reply to Re: Why no bareword warnings while inside of BEGIN (more)
in thread Why no bareword warnings while inside of BEGIN

The code to execute BEGIN immediately doesn't properly check the compilation error flag before executing the block. Here's a patch against 5.8.3:
--- op.c.orig 2004-03-22 16:59:09.000000000 -0800 +++ op.c 2004-03-22 16:59:25.000000000 -0800 @@ -4359,7 +4359,7 @@ if (*s != 'B' && *s != 'E' && *s != 'C' && *s != 'I') goto done; - if (strEQ(s, "BEGIN")) { + if (strEQ(s, "BEGIN") && !PL_error_count) { I32 oldscope = PL_scopestack_ix; ENTER; SAVECOPFILE(&PL_compiling);
It already appears to be fixed in 5.9.1.