summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>1998-10-17 17:22:02 -0500
committerGurusamy Sarathy <gsar@cpan.org>1998-10-25 06:39:04 +0000
commitbf8481137c02593eb36f8d0e234a2ec41a1c92e4 (patch)
treebbd9e7a59958e6ed888b6c0ab480f80cc65f58bf /toke.c
parent350ccacde22c7ee560c24442356e2a429691af6f (diff)
downloadperl-bf8481137c02593eb36f8d0e234a2ec41a1c92e4.tar.gz
Re: '*' prototype does not allow bareword with strict
Message-ID: <19981017222202.J510@pobox.com> p4raw-id: //depot/perl@2061
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/toke.c b/toke.c
index 9db82c6bfc..839ef140ad 100644
--- a/toke.c
+++ b/toke.c
@@ -3158,8 +3158,11 @@ int yylex
if (*s == '(') {
CLINE;
if (gv && GvCVu(gv)) {
+ CV *cv;
+ if ((cv = GvCV(gv)) && SvPOK(cv))
+ PL_last_proto = SvPV((SV*)cv, PL_na);
for (d = s + 1; *d == ' ' || *d == '\t'; d++) ;
- if (*d == ')' && (sv = cv_const_sv(GvCV(gv)))) {
+ if (*d == ')' && (sv = cv_const_sv(cv))) {
s = d + 1;
goto its_constant;
}
@@ -3168,6 +3171,7 @@ int yylex
PL_expect = XOPERATOR;
force_next(WORD);
yylval.ival = 0;
+ PL_last_lop_op = OP_ENTERSUB;
TOKEN('&');
}
@@ -3206,6 +3210,7 @@ int yylex
/* Resolve to GV now. */
op_free(yylval.opval);
yylval.opval = newCVREF(0, newGVOP(OP_GV, 0, gv));
+ PL_last_lop_op = OP_ENTERSUB;
/* Is there a prototype? */
if (SvPOK(cv)) {
STRLEN len;
@@ -3232,7 +3237,10 @@ int yylex
PL_last_lop_op != OP_TRUNCATE && /* S/F prototype in opcode.pl */
PL_last_lop_op != OP_ACCEPT &&
PL_last_lop_op != OP_PIPE_OP &&
- PL_last_lop_op != OP_SOCKPAIR)
+ PL_last_lop_op != OP_SOCKPAIR &&
+ !(PL_last_lop_op == OP_ENTERSUB
+ && PL_last_proto
+ && PL_last_proto[PL_last_proto[0] == ';' ? 1 : 0] == '*'))
{
warn(
"Bareword \"%s\" not allowed while \"strict subs\" in use",