summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-09-20 03:06:10 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-09-20 03:06:10 +0000
commit5a844595b9262407e093364ec4d29a22962723f0 (patch)
tree26cc1f15a25dbb3a9f2a698c89b85b9c7c37fd0e /gv.c
parent371b7e1ad2e46c79c7794d9b0f41b49157e7653c (diff)
downloadperl-5a844595b9262407e093364ec4d29a22962723f0.tar.gz
queue errors due to strictures rather than printing them as
warnings; symbols that violate strictures do *not* end up in the symbol table anyway, making multiple evals of the same piece of code produce the same errors; errors indicate all locations of a global symbol rather than just the first one; these changes make compile-time failures within evals reliably visible via the return value or contents of $@, and trappable using __DIE__ hooks p4raw-id: //depot/perl@4197
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/gv.c b/gv.c
index ae76f82949..29131ee323 100644
--- a/gv.c
+++ b/gv.c
@@ -568,26 +568,15 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type)
/* By this point we should have a stash and a name */
if (!stash) {
- if (!add)
- return Nullgv;
- {
- char sv_type_char = ((sv_type == SVt_PV) ? '$'
- : (sv_type == SVt_PVAV) ? '@'
- : (sv_type == SVt_PVHV) ? '%'
- : 0);
- if (sv_type_char)
- Perl_warn(aTHX_ "Global symbol \"%c%s\" requires explicit package name",
- sv_type_char, name);
- else
- Perl_warn(aTHX_ "Global symbol \"%s\" requires explicit package name",
- name);
+ if (add) {
+ qerror(Perl_mess(aTHX_
+ "Global symbol \"%s%s\" requires explicit package name",
+ (sv_type == SVt_PV ? "$"
+ : sv_type == SVt_PVAV ? "@"
+ : sv_type == SVt_PVHV ? "%"
+ : ""), name));
}
- ++PL_error_count;
- stash = PL_curstash ? PL_curstash : PL_defstash; /* avoid core dumps */
- add_gvflags = ((sv_type == SVt_PV) ? GVf_IMPORTED_SV
- : (sv_type == SVt_PVAV) ? GVf_IMPORTED_AV
- : (sv_type == SVt_PVHV) ? GVf_IMPORTED_HV
- : 0);
+ return Nullgv;
}
if (!SvREFCNT(stash)) /* symbol table under destruction */