This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
allow perlbug -ok when STDIN it not a tty
[perl5.git] / perly.y
diff --git a/perly.y b/perly.y
index 6313061..a1a1f0d 100644 (file)
--- a/perly.y
+++ b/perly.y
@@ -17,7 +17,7 @@
 #include "perl.h"
 
 static void
-dep()
+dep(void)
 {
     deprecate("\"do\" to call subroutines");
 }
@@ -153,6 +153,9 @@ sideff      :       error
                        { $$ = newLOOPOP(OPf_PARENS, 1, scalar($3), $1); }
        |       expr UNTIL iexpr
                        { $$ = newLOOPOP(OPf_PARENS, 1, $3, $1);}
+       |       expr FOR expr
+                       { $$ = newFOROP(0, Nullch, $2,
+                                       Nullop, $3, $1, Nullop); }
        ;
 
 else   :       /* NULL */
@@ -288,8 +291,9 @@ startformsub:       /* NULL */      /* start a format subroutine scope */
                        { $$ = start_subparse(TRUE, 0); }
        ;
 
-subname        :       WORD    { char *name = SvPVx(((SVOP*)$1)->op_sv, na);
-                         if (strEQ(name, "BEGIN") || strEQ(name, "END"))
+subname        :       WORD    { char *name = SvPV(((SVOP*)$1)->op_sv, na);
+                         if (strEQ(name, "BEGIN") || strEQ(name, "END")
+                             || strEQ(name, "INIT"))
                              CvUNIQUE_on(compcv);
                          $$ = $1; }
        ;
@@ -438,7 +442,7 @@ term        :       term ASSIGNOP term
        |       scalar  %prec '('
                        { $$ = $1; }
        |       star '{' expr ';' '}'
-                       { $$ = newBINOP(OP_GELEM, 0, newGVREF(0,$1), $3); }
+                       { $$ = newBINOP(OP_GELEM, 0, $1, scalar($3)); }
        |       star    %prec '('
                        { $$ = $1; }
        |       scalar '[' expr ']'     %prec '('