Message-ID: <
20010314041610.A16307@puffinry.freeserve.co.uk>
p4raw-id: //depot/perl@9147
if (label && *label) {
OP *gotoprobe = 0;
bool leaving_eval = FALSE;
+ PERL_CONTEXT *last_eval_cx = 0;
/* find label */
case CXt_EVAL:
leaving_eval = TRUE;
if (CxREALEVAL(cx)) {
- gotoprobe = PL_eval_root; /* XXX not good for nested eval */
+ gotoprobe = (last_eval_cx ?
+ last_eval_cx->blk_eval.old_eval_root :
+ PL_eval_root);
+ last_eval_cx = cx;
break;
}
/* else fall through */
# "This IS structured code. It's just randomly structured."
-print "1..21\n";
+print "1..22\n";
while ($?) {
$foo = 1;
print ($ok&&!$@ ? "ok 21\n" : "not ok 21\n");
+# Test that goto works in nested eval-string
+$ok = 0;
+{eval q{
+ eval q{
+ goto LABEL22;
+ };
+ $ok = 0;
+ last;
+
+ LABEL22: $ok = 1;
+};
+$ok = 0 if $@;
+}
+print ($ok ? "ok 22\n" : "not ok 22\n");
+
exit;
bypass: