summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-09-06 22:57:50 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-09-15 22:45:08 -0700
commit689aac7bfc3ed834caafc028165e62b1badfb320 (patch)
tree5c1e955cd06b7f2ba422a338508916ef7cd72867 /toke.c
parent445f13ff0d8bfc70e382b8372318dad6ad0d9bd2 (diff)
downloadperl-689aac7bfc3ed834caafc028165e62b1badfb320.tar.gz
Don’t mention pkg in proto warnings for lex subs
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/toke.c b/toke.c
index c34d43d42a..dee576817d 100644
--- a/toke.c
+++ b/toke.c
@@ -8279,7 +8279,11 @@ Perl_yylex(pTHX)
if (PL_madskills)
nametoke = newSVpvn_flags(s, d - s, SvUTF8(PL_linestr));
#endif
- if (memchr(tmpbuf, ':', len) || key == KEY_our)
+ *PL_tokenbuf = '&';
+ if (memchr(tmpbuf, ':', len) || key != KEY_sub
+ || pad_findmy_pvn(
+ PL_tokenbuf, len + 1, UTF ? SVf_UTF8 : 0
+ ) != NOT_IN_PAD)
sv_setpvn(PL_subname, tmpbuf, len);
else {
sv_setsv(PL_subname,PL_curstname);
@@ -8290,7 +8294,6 @@ Perl_yylex(pTHX)
SvUTF8_on(PL_subname);
have_name = TRUE;
- *PL_tokenbuf = '&';
#ifdef PERL_MAD
start_force(0);