Perl_ck_concat(pTHX_ OP *o)
{
OP *kid = cUNOPo->op_first;
- if (kid->op_type == OP_CONCAT && !(kUNOP->op_first->op_flags & OPf_MOD))
+ if (kid->op_type == OP_CONCAT && !(kid->op_private & OPpTARGET_MY) &&
+ !(kUNOP->op_first->op_flags & OPf_MOD))
o->op_flags |= OPf_STACKED;
return o;
}
}
OP *
+Perl_ck_unpack(pTHX_ OP *o)
+{
+ OP *kid = cLISTOPo->op_first;
+ if (kid->op_sibling) {
+ kid = kid->op_sibling;
+ if (!kid->op_sibling)
+ kid->op_sibling = newDEFSVOP();
+ }
+ return ck_fun(o);
+}
+
+OP *
Perl_ck_substr(pTHX_ OP *o)
{
o = ck_fun(o);
o->op_seq = PL_op_seqmax++;
break;
+ case OP_CONCAT:
+ if (o->op_next && o->op_next->op_type == OP_STRINGIFY) {
+ if (o->op_next->op_private & OPpTARGET_MY) {
+ if (o->op_flags & OPf_STACKED) /* chained concats */
+ goto ignore_optimization;
+ else {
+ /* assert(PL_opargs[o->op_type] & OA_TARGLEX); */
+ o->op_targ = o->op_next->op_targ;
+ o->op_next->op_targ = 0;
+ o->op_private |= OPpTARGET_MY;
+ }
+ }
+ op_null(o->op_next);
+ }
+ ignore_optimization:
+ o->op_seq = PL_op_seqmax++;
+ break;
case OP_STUB:
if ((o->op_flags & OPf_WANT) != OPf_WANT_LIST) {
o->op_seq = PL_op_seqmax++;