Thanks for the reply.

I have made the recommended changes to &conflict_check and the innermost foreach but the behaviour is the same. The best way I could describe it is that it is treating the next as a last.

I always use use strict and warnings - it actually makes it easier because the errors are more helpful for fixing things before they have a confusing knock-on effect for other lines.

All of the lines I have included are wrapped by PerlMonks - it's much clearer without this. There are several logs in the script, they are part of an equation a couple of thousand lines long with 185 variables. I know this code works because they are working fine as part of a manual process where frequency, antenna length and channel width are selected by the user. The only part that doesn't work properly is this while/foreach nested loop which doesn't cycle through antenna lengths as expected.

I have included below all lines that I could find with log (in no particular order) and the log subroutine. All of the log lines are either part of &calculate_rsl;, &calculate_oav_h or &calculate_oav_v; - all of which shouldn't be reached if certain antenna lengths match incompatible frequencies as defined in &conflict_check;.

$FREE_SPACE_PATH_LOSS = 92.45+20*log10($PATH_LENGTH)+20*log10($FREQUEN +CY); $OUTAGE_FACTOR_H = 0.139735174-0.172*log10($FADE_MARGIN/$PATH_ATTENUAT +ION_H); $GEOCLIMATIC_CONVERSION_FACTOR = (10.3-5*log10(1-abs(cos($LATITUDE))** +0.7)-2.8*log10($PATH_LENGTH)+1.8*log10(abs($INCLINATION))); $OUTAGE_FACTOR_V = 0.139735174-0.172*log10($FADE_MARGIN/$PATH_ATTENUAT +ION_V); sub log10 { my $n = shift; return log($n)/log(10); }

Thanks for any additional help that anybody can offer :-)

Kind regards,

Ben


In reply to Re^2: Nested While Loops, foreach and next by Chipwiz_Ben
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.