Your code is rather unreadable due to poor indenting.
Your post includes far more code than necessary to demonstrate the problem.
Your post includes too little to demonstrate the problem. You're saying the problem is that a call to log is being reached when it shouldn't, yet there is no such function call in your code.
You've made it impossible for us to help you because Perl does indeed behave as you think it should.
When next is called in
Perl does indeed skip the to the next pass of the loop directly (skipping log), although it does issue a warning* because the following would be clearerfor (...) { ... &conflict_check; ... log ... } sub conflict_check { ... if (...) { next; } ... }
for (...) { ... next if &conflict_exists; ... log ... } sub conflict_exists { ... if (...) { return 1; } ... return 0; }
* — Please tell me you are using use strict; use warnings;.
In reply to Re: Nested While Loops, foreach and next
by ikegami
in thread Nested While Loops, foreach and next
by Chipwiz_Ben
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |