summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-10-05 17:25:57 -0700
committerFather Chrysostomos <sprout@cpan.org>2014-10-05 17:25:57 -0700
commita21eb52b1988ec2828792ad77f68a17dda3e6feb (patch)
tree6d91d9a4f3f705440f30ae46af07fea1bf051937 /toke.c
parent82a7b38ebca5ead4666341f73512665b295afd51 (diff)
downloadperl-a21eb52b1988ec2828792ad77f68a17dda3e6feb.tar.gz
Correct ‘"my" variable "&f::b"...’ message
"my" variable &foo::bar can't be in a package at - line 2, near "my sub foo::bar" It should say ‘subroutine’, not ‘variable’. When I implemented lexi- cal subs, I thought I caught all these, must I missed this one.
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/toke.c b/toke.c
index f48fa287c0..9efdd80e39 100644
--- a/toke.c
+++ b/toke.c
@@ -8118,7 +8118,9 @@ S_pending_ident(pTHX)
/* PL_no_myglob is constant */
GCC_DIAG_IGNORE(-Wformat-nonliteral);
yyerror_pv(Perl_form(aTHX_ PL_no_myglob,
- PL_in_my == KEY_my ? "my" : "state", PL_tokenbuf),
+ PL_in_my == KEY_my ? "my" : "state",
+ *PL_tokenbuf == '&' ? "subroutin" : "variabl",
+ PL_tokenbuf),
UTF ? SVf_UTF8 : 0);
GCC_DIAG_RESTORE;
}