summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--op.c7
-rw-r--r--pp.c4
2 files changed, 9 insertions, 2 deletions
diff --git a/op.c b/op.c
index 1b24320f20..2619e2748f 100644
--- a/op.c
+++ b/op.c
@@ -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
diff --git a/pp.c b/pp.c
index 48786f0636..c796dcc0fb 100644
--- a/pp.c
+++ b/pp.c
@@ -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);
}