#!./perl
print "1..22\n";
print tmp "tvi925\n";
print tmp "tvi920\n";
print tmp "vt100\n";
print tmp "Amiga\n";
print tmp "paper\n";
# test "last" command
while (<fh>) {
}
# test "next" command
$bad = '';
while (<fh>) {
next if /vt100/;
}
# test "redo" command
$bad = '';
while (<fh>) {
redo;
}
}
# now do the same with a label and a continue block
# test "last" command
$badcont = '';
} continue {
}
# test "next" command
$bad = '';
$badcont = 1;
} continue {
}
# test "redo" command
$bad = '';
$badcont = '';
}
} continue {
}
#$x = 0;
#while (1) {
# if ($x > 1) {last;}
# next;
#} continue {
# if ($x++ > 10) {last;}
# next;
#}
#
#if ($x < 10) {print "ok 10\n";} else {print "not ok 10\n";}
$i = 9;
{
$i++;
}
print "ok $i\n";
# Check curpm is reset when jumping out of a scope
'abc' =~ /b/;
while (1) {
$i++;
print "ok $i\n";
{ # Localize changes to $` and friends
'end' =~ /end/;
next WHILE if $i == 12;
# 13 do a normal loop
}
}
$i++;
# check that scope cleanup happens right when there's a continue block
{
my $var = 16;
while (my $i = ++$var) {
next if $i == 17;
last if $i > 17;
my $i = 0;
}
continue {
}
}
{
local $l = 18;
{
local $l = 0
}
continue {
}
}
{
local $l = 19;
my $x = 0;
while (!$x++) {
local $l = 0
}
continue {
}
}
$i = 20;
{
while (1) {
my $x;
print $x if defined $x;
if ($i == 21) {
next;
}
last;
}
continue {
}
}