I'm posting this at the top, because otherwise it would be lost down in the level 5 of comments to comments to comments. The code (we learned later) looks like this:
while ( my @col_col = $sthZK_Update_extract->fetchrow() ) { #stuff my $SUM_xi = $col_col[5]; my $SUM_ni = $col_col[6]; # more stuff print "\n^^^^^^\n$Key_m, $Aggregated_area, $Cause, $SUM_wixi, $S +UM_wi, $SU +M_xi, $SUM_ni, $Sum_wi2xi\n"; } my $numerator_L = 2*($SUM_ni-$SUM_xi);
Remember how I asked you to print the values JUST at the point were you were using them? Because I thought the values were not what you thought they were.

You are declaring variables with my - giving them scope inside the loop.

Once you are outside of the loop, the values are GONE.

If you had put the print statement just before the assign statement, you would have caught it yourself. If you had done use strict; Perl would have caught it for you. That is (one of) the reasons why use strict; is a really, really good idea.


In reply to AHA! by matija
in thread Float values from MS SQL Server. by Win

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.