summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-07-02 21:26:13 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-09-15 22:44:54 -0700
commit4b473a5a056427bc93ffb46dbb873c9e6ec5287f (patch)
treee6603cbb600c5dbac82436bb013ed6a611e2877d /toke.c
parent945534e1d3d80e5758511e1e2700775217d07796 (diff)
downloadperl-4b473a5a056427bc93ffb46dbb873c9e6ec5287f.tar.gz
Make do sub() respect our declarations
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/toke.c b/toke.c
index 1a82259553..6912863148 100644
--- a/toke.c
+++ b/toke.c
@@ -7423,10 +7423,15 @@ Perl_yylex(pTHX)
if (*s == '{')
PRETERMBLOCK(DO);
if (*s != '\'') {
- d = scan_word(s, PL_tokenbuf, sizeof PL_tokenbuf, 1, &len);
- if (len) {
+ *PL_tokenbuf = '&';
+ d = scan_word(s, PL_tokenbuf + 1, sizeof PL_tokenbuf - 1,
+ 1, &len);
+ if (len && !keyword(PL_tokenbuf + 1, len, 0)) {
d = SKIPSPACE1(d);
- if (*d == '(') s = force_word(s,WORD,TRUE,TRUE,FALSE);
+ if (*d == '(') {
+ PL_pending_ident = '&';
+ s = d;
+ }
}
}
if (orig_keyword == KEY_do) {