in reply to Re: Nested While Loops, foreach and next
in thread Nested While Loops, foreach and next
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Nested While Loops, foreach and next
by ikegami (Patriarch) on Jun 03, 2011 at 00:40 UTC |