From: Gurusamy Sarathy Date: Sun, 12 Mar 2000 03:45:27 +0000 (+0000) Subject: Larry's patch to disallow CORE::Snark, with perldiag entry X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6798c92bb7a17a5333f2eeaaadd5e3c017b4529a;p=p5sagit%2Fp5-mst-13.2.git Larry's patch to disallow CORE::Snark, with perldiag entry p4raw-id: //depot/perl@5671 --- diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 2c4c9a7..ef6fa00 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -2152,6 +2152,10 @@ corresponding bit of $^H as well. (F) Compile-time-substitutions (such as overloaded constants and character names) were not correctly set up. +=item CORE::%s is not a keyword + +(F) The CORE:: namespace is reserved for Perl keywords. + =item defined(@array) is deprecated (D) defined() is not usually useful on arrays because it checks for an diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 23c376b..8701714 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -1269,6 +1269,10 @@ character names) were not correctly set up. (F) The method which overloads "=" is buggy. See L. +=item CORE::%s is not a keyword + +(F) The CORE:: namespace is reserved for Perl keywords. + =item Corrupt malloc ptr 0x%lx at 0x%lx (P) The malloc package that comes with Perl had an internal failure. diff --git a/toke.c b/toke.c index 2e6120d..8177476 100644 --- a/toke.c +++ b/toke.c @@ -3958,7 +3958,8 @@ Perl_yylex(pTHX) s += 2; d = s; s = scan_word(s, PL_tokenbuf, sizeof PL_tokenbuf, FALSE, &len); - tmp = keyword(PL_tokenbuf, len); + if (!(tmp = keyword(PL_tokenbuf, len))) + Perl_croak(aTHX_ "CORE::%s is not a keyword", PL_tokenbuf); if (tmp < 0) tmp = -tmp; goto reserved_word;