The current OP that is tested in doeval() can be a require(), an
Rafael Garcia-Suarez [Tue, 17 Jan 2006 19:03:51 +0000 (19:03 +0000)]
eval() or a do(). When we test whether OPf_SPECIAL is set on it, be
sure to take into account that it's the eval-related meaning of
OPf_SPECIAL we're testing for, not the require-related one.

p4raw-id: //depot/perl@26881

pp_ctl.c

index 8675561..bdacfce 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2922,7 +2922,7 @@ S_doeval(pTHX_ int gimme, OP** startop, CV* outside, U32 seq)
     PL_error_count = 0;
     PL_curcop = &PL_compiling;
     PL_curcop->cop_arybase = 0;
-    if (saveop && saveop->op_flags & OPf_SPECIAL)
+    if (saveop && saveop->op_type != OP_REQUIRE && saveop->op_flags & OPf_SPECIAL)
        PL_in_eval |= EVAL_KEEPERR;
     else
        sv_setpvn(ERRSV,"",0);