#!./perl
print "1..13\n";
for ($i = 0; $i <= 10; $i++) {
$x[$i] = $i;
}
$y = $x[10];
print "#1 :$y: eq :10:\n";
print "#1 :$y: eq :0 1 2 3 4 5 6 7 8 9 10:\n";
print "ok 1\n";
} else {
print "not ok 1\n";
}
$i = $c = 0;
for (;;) {
$c++;
last if $i++ > 10;
}
if ($c == 12) {print "ok 2\n";} else {print "not ok 2\n";}
$foo = 3210;
@ary = (1,2,3,4,5);
$foo *= 2;
}
for (@ary) {
}
print $ary[1];
# test for internal scratch array generation
# this also tests that $foo was restored to 3210 after test 3
$foo .= $_;
}
print $foo;
}
for $i (1..5) {
return $i if $_[0] == $i;
}
}
return (1, 2, 4);
}
$a = 0;
$a += $b;
}
print $a == 7 ? "ok" : "not ok", " 11\n";
$loop_count = 0;
for ("-3" .. "0") {
$loop_count++;
}
# modifying arrays in loops is a no-no
@a = (3,4);
eval { @a = () for (1,2,@a) };