summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-06-20 18:58:06 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-06-20 18:58:06 +0000
commitce29ac451034df067115e81c1d12f5f8c0114302 (patch)
treeae84408029763d15a24d1d491b023c0096ace1af /toke.c
parentff5ad48a406d02420ef1036954fc4b1323a7f781 (diff)
downloadperl-ce29ac451034df067115e81c1d12f5f8c0114302.tar.gz
Fix for ID 20010619.002 "When building hash, hash keys that
are function calls are not being called", from Abhijit. p4raw-id: //depot/perl@10763
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/toke.c b/toke.c
index 34e2fd4306..faa8bba1f4 100644
--- a/toke.c
+++ b/toke.c
@@ -3925,6 +3925,7 @@ Perl_yylex(pTHX)
default: /* not a keyword */
just_a_word: {
SV *sv;
+ int pkgname = 0;
char lastchar = (PL_bufptr == PL_oldoldbufptr ? 0 : PL_bufptr[-1]);
/* Get the rest if it looks like a package qualifier */
@@ -3937,6 +3938,7 @@ Perl_yylex(pTHX)
Perl_croak(aTHX_ "Bad name after %s%s", PL_tokenbuf,
*s == '\'' ? "'" : "::");
len += morelen;
+ pkgname = 1;
}
if (PL_expect == XOPERATOR) {
@@ -4024,12 +4026,11 @@ Perl_yylex(pTHX)
}
}
-
PL_expect = XOPERATOR;
s = skipspace(s);
/* Is this a word before a => operator? */
- if (*s == '=' && s[1] == '>') {
+ if (*s == '=' && s[1] == '>' && !pkgname) {
CLINE;
sv_setpv(((SVOP*)yylval.opval)->op_sv, PL_tokenbuf);
if (UTF && !IN_BYTES && is_utf8_string((U8*)PL_tokenbuf, len))