diff options
author | Chip Salzenberg <chip@perl.com> | 1997-04-09 00:00:00 +0000 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1997-04-09 00:00:00 +0000 |
commit | 6d4c2119f5cbed48a635a73f723f5d62428daf0a (patch) | |
tree | a3a8bb33198a6e100a2b8728768bdbbf635e1880 /op.c | |
parent | 4e5f255bc79a4d332832eda907f7e26f656b7ec2 (diff) | |
download | perl-6d4c2119f5cbed48a635a73f723f5d62428daf0a.tar.gz |
Before 'BEGIN not safe', explain why
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -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) { |