This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate change #7784 from mainline into maintperl.
[perl5.git] / pp_ctl.c
index 86fda1a..1816b6d 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2736,7 +2736,7 @@ Perl_sv_compile_2op(pTHX_ SV *sv, OP** startop, char *code, AV** avp)
     PL_op = &dummy;
     PL_op->op_type = OP_ENTEREVAL;
     PL_op->op_flags = 0;                       /* Avoid uninit warning. */
-    PUSHBLOCK(cx, CXt_EVAL, SP);
+    PUSHBLOCK(cx, CXt_EVAL|(PL_curcop == &PL_compiling ? 0 : CXp_REAL), SP);
     PUSHEVAL(cx, 0, Nullgv);
     rop = doeval(G_SCALAR, startop);
     POPBLOCK(cx,PL_curpm);