From: Michael G. Schwern Date: Sat, 14 Apr 2001 22:13:59 +0000 (+0100) Subject: Exit via last, part 1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=264cef28e9f800426234a9e31007e10cc2439aa3;p=p5sagit%2Fp5-mst-13.2.git Exit via last, part 1 Message-ID: <20010414221359.A413@blackrider.blackstar.co.uk> p4raw-id: //depot/perl@9711 --- diff --git a/t/op/loopctl.t b/t/op/loopctl.t index a7416f2..2ed9df1 100644 --- a/t/op/loopctl.t +++ b/t/op/loopctl.t @@ -31,7 +31,7 @@ # # -- .robin. 2001-03-13 -print "1..39\n"; +print "1..41\n"; my $ok; @@ -923,3 +923,24 @@ TEST39: { } } print ($ok ? "ok 39\n" : "not ok 39\n"); + + +### Test that loop control is dynamicly scoped. + +sub test_last_label { last TEST40 } + +TEST40: { + $ok = 1; + test_last_label(); + $ok = 0; +} +print ($ok ? "ok 40\n" : "not ok 40\n"); + +sub test_last { last } + +TEST41: { + $ok = 1; + test_last(); + $ok = 0; +} +print ($ok ? "ok 41\n" : "not ok 41\n");