$\1 and serious bug in evalling
[p5sagit/p5-mst-13.2.git] / perly.y
diff --git a/perly.y b/perly.y
index b181d5f..be6fe98 100644 (file)
--- a/perly.y
+++ b/perly.y
@@ -208,8 +208,8 @@ loop        :       label WHILE '(' remember mtexpr ')' mblock cont
                        /* basically fake up an initialize-while lineseq */
                        { copline = $2;
                            $$ = block_end($4,
-                                  append_elem(OP_LINESEQ, scalar($5),
-                                    newSTATEOP(0, $1,
+                                  newSTATEOP(0, $1,
+                                    append_elem(OP_LINESEQ, scalar($5),
                                       newWHILEOP(0, 1, (LOOP*)Nullop,
                                                  scalar($7),
                                                  $11, scalar($9))))); }
@@ -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; }