5 open (tmp,'>Cmd_while.tmp') || die "Can't create Cmd_while.tmp.";
11 close tmp or die "Could not close: $!";
15 open(fh,'Cmd_while.tmp') || die "Can't open Cmd_while.tmp.";
19 if (!eof && /vt100/) {print "ok 1\n";} else {print "not ok 1 $_\n";}
24 open(fh,'Cmd_while.tmp') || die "Can't open Cmd_while.tmp.";
29 if (!eof || /vt100/ || $bad) {print "not ok 2\n";} else {print "ok 2\n";}
34 open(fh,'Cmd_while.tmp') || die "Can't open Cmd_while.tmp.";
36 if (s/vt100/VT100/g) {
43 if (!eof || $bad) {print "not ok 3\n";} else {print "ok 3\n";}
45 # now do the same with a label and a continue block
50 open(fh,'Cmd_while.tmp') || die "Can't open Cmd_while.tmp.";
52 if (/vt100/) {last line;}
54 $badcont = 1 if /vt100/;
56 if (!eof && /vt100/) {print "ok 4\n";} else {print "not ok 4\n";}
57 if (!$badcont) {print "ok 5\n";} else {print "not ok 5\n";}
63 open(fh,'Cmd_while.tmp') || die "Can't open Cmd_while.tmp.";
65 next entry if /vt100/;
68 $badcont = '' if /vt100/;
70 if (!eof || /vt100/ || $bad) {print "not ok 6\n";} else {print "ok 6\n";}
71 if (!$badcont) {print "ok 7\n";} else {print "not ok 7\n";}
77 open(fh,'Cmd_while.tmp') || die "Can't open Cmd_while.tmp.";
79 if (s/vt100/VT100/g) {
86 $badcont = 1 if /vt100/;
88 if (!eof || $bad) {print "not ok 8\n";} else {print "ok 8\n";}
89 if (!$badcont) {print "ok 9\n";} else {print "not ok 9\n";}
91 close(fh) || die "Can't close Cmd_while.tmp.";
92 unlink 'Cmd_while.tmp' || `/bin/rm Cmd_While.tmp`;
99 # if ($x++ > 10) {last;}
103 #if ($x < 10) {print "ok 10\n";} else {print "not ok 10\n";}
111 # Check curpm is reset when jumping out of a scope
116 print "#$`,$&,$',\nnot " unless $` . $& . $' eq "abc";
118 { # Localize changes to $` and friends
120 redo WHILE if $i == 11;
121 next WHILE if $i == 12;
122 # 13 do a normal loop
123 last WHILE if $i == 14;
127 print "not " unless $` . $& . $' eq "abc";
130 # check that scope cleanup happens right when there's a continue block
133 while (my $i = ++$var) {
139 print "ok ", $var-1, "\nok $i\n";
168 print $x if defined $x;
170 print "ok $i\n"; ++$i;
177 print "ok $i\n"; ++$i;