diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-20 18:58:06 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-06-20 18:58:06 +0000 |
commit | ce29ac451034df067115e81c1d12f5f8c0114302 (patch) | |
tree | ae84408029763d15a24d1d491b023c0096ace1af /toke.c | |
parent | ff5ad48a406d02420ef1036954fc4b1323a7f781 (diff) | |
download | perl-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.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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)) |