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

for (...) { ... &conflict_check; ... log ... } sub conflict_check { ... if (...) { next; } ... }
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 clearer
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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.