summaryrefslogtreecommitdiff
path: root/perly.y
diff options
context:
space:
mode:
authorChip Salzenberg <chip@perl.com>1997-04-30 00:00:00 +1200
committerChip Salzenberg <chip@atlantic.net>1997-04-30 00:00:00 +1200
commit6da72b644b845971d5b417f3c6f5590e23084bcd (patch)
tree322d1e0b1a154d0b12f1fcc49838fe9a9aa4288c /perly.y
parent404b15a1d1b7c56f5774b99fd0d4b6854620182b (diff)
downloadperl-6da72b644b845971d5b417f3c6f5590e23084bcd.tar.gz
Support C< $coderef->($x,$y) >
Randal Schwartz said: > Some time in October, 1994, Larry Wall said: > > : All other references you can follow with ->, what about code refs? > > Aw, look, I'd really like that feature in, but I think it's a bit > > too close to the release for that. > Hey Chip, > Look, Larry said he'd really like that feature Larry said that? That change is like two lines, it's in! Tricked-into-doing-by: Randal Schwartz <merlyn@stonehenge.com>
Diffstat (limited to 'perly.y')
-rw-r--r--perly.y7
1 files changed, 7 insertions, 0 deletions
diff --git a/perly.y b/perly.y
index 3bf1fdaf60..be6fe98f20 100644
--- a/perly.y
+++ b/perly.y
@@ -529,6 +529,13 @@ term : term ASSIGNOP term
prepend_elem(OP_LIST,
$4,
scalar(newCVREF(0,scalar($2))))); dep();}
+ | term ARROW '(' ')' %prec '('
+ { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
+ newCVREF(0, scalar($1))); }
+ | term ARROW '(' expr ')' %prec '('
+ { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
+ append_elem(OP_LIST, $4,
+ newCVREF(0, scalar($1)))); }
| LOOPEX
{ $$ = newOP($1, OPf_SPECIAL);
hints |= HINT_BLOCK_SCOPE; }