This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Perldelta for b0f2e9e - buildtoc fixes
[perl5.git] / pp_ctl.c
index b38e8e6..a9012ee 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3649,7 +3649,7 @@ S_doeval(pTHX_ int gimme, OP** startop, CV* outside, U32 seq, HV *hh)
                sv_setpvs(ERRSV, "Compilation error");
            }
        }
-       PUSHs(&PL_sv_undef);
+       if (gimme != G_ARRAY) PUSHs(&PL_sv_undef);
        PUTBACK;
        return FALSE;
     }
@@ -5024,7 +5024,9 @@ PP(pp_leavewhen)
 
     cxix = dopoptogiven(cxstack_ix);
     if (cxix < 0)
-       DIE(aTHX_ "Can't use when() outside a topicalizer");
+       /* diag_listed_as: Can't "when" outside a topicalizer */
+       DIE(aTHX_ "Can't \"%s\" outside a topicalizer",
+                  PL_op->op_flags & OPf_SPECIAL ? "default" : "when");
 
     POPBLOCK(cx,newpm);
     assert(CxTYPE(cx) == CXt_WHEN);