&error("Invalid input") unless &valid($input);
$i *= 2 until $i > $j;
print " ", ($n += 2) while $n < 10;
&greet($_) foreach @person;
print "$n is a negative number.\n" if $n < 0;
Now, take away the while keyword and the conditional expression, and you’ll have a
naked block:
{
body;
body;
body;
}
The naked block is like a while or foreach loop, except that it doesn’t loop; it just
executes the body of the loop once, and it’s done. It’s an un-loop!
we use it maybe just because it can create privite variable.
阅读(271) | 评论(0) | 转发(0) |