Re: How to break from a do while loop in perl?
- From: "Matt Garrish" <matthew.garrish@xxxxxxxxxxxx>
- Date: Mon, 27 Mar 2006 21:40:45 -0500
"jeniffer" <zenith.of.perfection@xxxxxxxxx> wrote in message
news:1143510464.401145.166910@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
i read that last doesnt work inside a do while loop.Then how to break
out from a do-while loop...
do{
if(some condition)
{
last;
}
}while(condition)
Do what the docs say: wrap it in a labeled block (see perlsyn, "Statement
Modifiers").
Depending on how simple your loop is, you could also just set the while
condition to true in the if conditional and run your code in the else.
Matt
.
- References:
- How to break from a do while loop in perl?
- From: jeniffer
- How to break from a do while loop in perl?
- Prev by Date: Re: Why is my substitution doubling up on brackets?
- Next by Date: Re: How to break from a do while loop in perl?
- Previous by thread: How to break from a do while loop in perl?
- Next by thread: Re: How to break from a do while loop in perl?
- Index(es):
Relevant Pages
|