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 953a749..a9012ee 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -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);