The flow of the code does seem straight forward enough to suggest that it might by a representation issue. Rather than printing the values, you might consider printing the differences - if they are not literally identical, this should reveal what's getting lost (though I thought there was no truncation in an unformatted print statement). If this does prove to be the issue, you can avoid the false positives by setting a tolerance, e.g.:
my $tolerance = 1.0e-16; # Change this value based on observation
if ($tolerance*abs($range_min + $change_min) < abs($range_min - $chang
+e_min)) {
print "$variable has different minimum value:\n";
print " Change list: $changes{$variable}{min} ($changes{$variable
+}{sheet})\n";
print " Range file : $range_file{$variable}{min} ($range_file{$va
+riable}{sheet})\n";
my $difference = $range_min - $change_min
print " Difference : $difference\n";
}
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|