This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add Stephen Bennett to AUTHORS
[perl5.git] / op.c
diff --git a/op.c b/op.c
index 73dccf8..50a6179 100644 (file)
--- a/op.c
+++ b/op.c
@@ -10361,6 +10361,19 @@ Perl_coresub_op(pTHX_ SV * const coreargssv, const int code,
                                  newOP(OP_CALLER,0)
                       )
               );
+    case OP_SELECT: /* which represents OP_SSELECT as well */
+       if (code)
+           return newCONDOP(
+                        0,
+                        newBINOP(OP_GT, 0,
+                                 newAVREF(newGVOP(OP_GV, 0, PL_defgv)),
+                                 newSVOP(OP_CONST, 0, newSVuv(1))
+                                ),
+                        coresub_op(newSVuv((UV)OP_SSELECT), 0,
+                                   OP_SSELECT),
+                        coresub_op(coreargssv, 0, OP_SELECT)
+                  );
+       /* FALL THROUGH */
     default:
        switch (PL_opargs[opnum] & OA_CLASS_MASK) {
        case OA_BASEOP:
@@ -10384,7 +10397,11 @@ Perl_coresub_op(pTHX_ SV * const coreargssv, const int code,
                argop->op_private |= OPpCOREARGS_DEREF2;
            if (scalar_mod_type(NULL, opnum))
                argop->op_private |= OPpCOREARGS_SCALARMOD;
-           goto onearg;
+           if (opnum == OP_SUBSTR) {
+               o->op_private |= OPpMAYBE_LVSUB;
+               return o;
+           }
+           else goto onearg;
        }
     }
 }