summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 0750220063..68c50a5f40 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2252,6 +2252,10 @@ sv_compile_2op(SV *sv, OP** startop, char *code, AV** avp)
SAVETMPS;
/* switch to eval mode */
+ if (PL_curcop == &PL_compiling) {
+ SAVESPTR(PL_compiling.cop_stash);
+ PL_compiling.cop_stash = PL_curstash;
+ }
SAVESPTR(PL_compiling.cop_filegv);
SAVEI16(PL_compiling.cop_line);
sprintf(tmpbuf, "_<(%.10s_eval %lu)", code, (unsigned long)++PL_evalseq);