From: Chip Salzenberg Date: Wed, 9 Apr 1997 00:00:00 +0000 (+0000) Subject: Before 'BEGIN not safe', explain why X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6d4c2119f5cbed48a635a73f723f5d62428daf0a;p=p5sagit%2Fp5-mst-13.2.git Before 'BEGIN not safe', explain why --- diff --git a/op.c b/op.c index ef2940a..6a1fa5b 100644 --- a/op.c +++ b/op.c @@ -3270,8 +3270,17 @@ OP *block; if (name) { char *s = strrchr(name, ':'); s = s ? s+1 : name; - if (strEQ(s, "BEGIN")) - croak("BEGIN not safe after errors--compilation aborted"); + if (strEQ(s, "BEGIN")) { + char *not_safe = + "BEGIN not safe after errors--compilation aborted"; + if (in_eval & 4) + croak(not_safe); + else { + /* force display of errors found but not reported */ + sv_catpv(GvSV(errgv), not_safe); + croak("%s", SvPVx(GvSV(errgv), na)); + } + } } } if (!block) {