diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-11-06 16:18:48 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-11-08 08:15:58 -0800 |
commit | a96df643850d22bc4a943802c3dd142af0ab0057 (patch) | |
tree | 7cca2d887dc94f0f37c857d60f0e207f167e98aa /pp.c | |
parent | 466112bb8d1a607f81f127e9641f40ce1164c3e7 (diff) | |
download | perl-a96df643850d22bc4a943802c3dd142af0ab0057.tar.gz |
Stop lexical CORE sub from interfering with CORE::
The way CORE:: was handled in the lexer was convoluted.
CORE was treated initially as a keyword, with exceptions in the lexer
to make it behave correctly. If it turned out not to be followed
by ::, then the lexer would fall back to treating it as a bareword
or sub name.
Before even checking for a keyword, the lexer looks for :: and goes
to the bareword/sub code. But it made a special exception there
for CORE::.
In the end, treating CORE as a keyword recognized by the keyword()
function requires more special cases than simply special-casing CORE::
in toke.c.
This fixes the lexical CORE sub bug, while reducing the total num-
ber of lines.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -493,7 +493,7 @@ PP(pp_prototype) const char * s = SvPVX_const(TOPs); if (strnEQ(s, "CORE::", 6)) { const int code = keyword(s + 6, SvCUR(TOPs) - 6, 1); - if (!code || code == -KEY_CORE) + if (!code) DIE(aTHX_ "Can't find an opnumber for \"%"UTF8f"\"", UTF8fARG(SvFLAGS(TOPs) & SVf_UTF8, SvCUR(TOPs)-6, s+6)); { |