in reply to any mechanism to go to the end of a loop but do not exit the loop
You can always use a goto statement,
like
You might also checkout the continue flow control. With it, you could write it like:while (foo()) { ... goto JUST_BEFORE_END_OF_LOOP if bar(); ... ... JUST_BEFORE_OF_LOOP: clean_up }
while (foo()) { ... next if bar(); ... ... } continue { clean_up }
Greetings,
Janek Schleicher
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: any mechanism to go to the end of a loop but do not exit the loop
by ghosh123 (Monk) on Apr 17, 2014 at 16:31 UTC | |
by Laurent_R (Canon) on Apr 17, 2014 at 22:03 UTC |
In Section
Seekers of Perl Wisdom