Re: How do you continue in a for loop?
- From: Azazel <azazel@xxxxxxxxxx>
- Date: Tue, 31 Jul 2007 18:35:29 +0000 (UTC)
On 2007-07-31, Azazel <azazel@xxxxxxxxxx> wrote:
On 2007-07-31, Thierry <lamthierry@xxxxxxxxx> wrote:
In other languages, the for loop has a continue statement feature to
skip an interation, how do you do it in perl?
"next". For example:
for (my $i = 0; $i < 10; ++$i)
{
if ($i == 7)
{
next;
}
else
{
print $i, "\n";
}
}
Or rather:
for (my $i = 0; $i < 10; ++$i)
{
if ($i == 7)
{
next;
}
print $i, "\n";
}
.
- References:
- How do you continue in a for loop?
- From: Thierry
- Re: How do you continue in a for loop?
- From: Azazel
- How do you continue in a for loop?
- Prev by Date: Re: How do you continue in a for loop?
- Next by Date: CGI displays contents of script
- Previous by thread: Re: How do you continue in a for loop?
- Next by thread: Re: How do you continue in a for loop?
- Index(es):