in reply to Re^4: last in a do while loop (for (;;))
in thread last in a do while loop
Don't know if/when this will get looked at but I was unaware that a do-while loop didn't operate like a loop so last doesn't "work" with it. My problem is I have a structure similar to this. I'm guessing what I need is a way to keep reading the next line in the file, but at times I had problems assigning $aVar = <AFile>. Would a similar loop construct with $aVar = <Afile> being the final statement in that bare loop work?
while(<AFile>) { if(found keyword) do{ process keyword and next few lines if(done processing){ last } }while(<AFile>); # do some post processing } # Continue processing after this in the same file
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: last in a do while loop (for (;;))
by ikegami (Patriarch) on Jan 23, 2008 at 21:49 UTC | |
by JimmyDa (Initiate) on Jan 25, 2008 at 16:10 UTC | |
by ikegami (Patriarch) on Jan 26, 2008 at 02:32 UTC | |
Re^6: last in a do while loop (for (;;))
by rir (Vicar) on Jan 23, 2008 at 17:46 UTC |
In Section
Seekers of Perl Wisdom