summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-11-19 14:48:35 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-11-19 14:48:35 +0000
commit7fc307b5b2c2555eb36e722b92df29f8a8d5db19 (patch)
tree3ae4847a4572f181a5cf394df7c6a39e49ef918d /toke.c
parent1bb8ad523126a79135f26a08af30cf96a4989f0f (diff)
downloadperl-7fc307b5b2c2555eb36e722b92df29f8a8d5db19.tar.gz
Make "err" a weak keyword;
that is, it will be overriden by any sub named "err", except when really an operator is expected at this point. ([perl #32347]) p4raw-id: //depot/perl@23519
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/toke.c b/toke.c
index 7c9d88f4d9..a7a9068151 100644
--- a/toke.c
+++ b/toke.c
@@ -4037,6 +4037,16 @@ Perl_yylex(pTHX)
{
tmp = 0; /* any sub overrides "weak" keyword */
}
+ else if (gv && !gvp
+ && tmp == -KEY_err
+ && GvCVu(gv)
+ && PL_expect != XOPERATOR
+ && PL_expect != XTERMORDORDOR)
+ {
+ /* any sub overrides the "err" keyword, except when really an
+ * operator is expected */
+ tmp = 0;
+ }
else { /* no override */
tmp = -tmp;
if (tmp == KEY_dump && ckWARN(WARN_MISC)) {