diff options
-rw-r--r-- | op.c | 7 | ||||
-rw-r--r-- | pp.c | 4 |
2 files changed, 9 insertions, 2 deletions
@@ -12653,7 +12653,12 @@ Perl_rpeep(pTHX_ OP *o) break; case OP_SASSIGN: - if (OP_GIMME(o,0) == G_VOID) { + if (OP_GIMME(o,0) == G_VOID + || ( o->op_next->op_type == OP_LINESEQ + && ( o->op_next->op_next->op_type == OP_LEAVESUB + || ( o->op_next->op_next->op_type == OP_RETURN + && !CvLVALUE(PL_compcv))))) + { OP *right = cBINOP->op_first; if (right) { /* sassign @@ -3186,7 +3186,9 @@ PP(pp_substr) } } SPAGAIN; - if (rvalue) { + if (PL_op->op_private & OPpSUBSTR_REPL_FIRST) + SP++; + else if (rvalue) { SvSETMAGIC(TARG); PUSHs(TARG); } |