Update: This is solved. The note that 'Runtime warnings triggered in elsif conditions are reported with the line number of the original if condition.' was the key. Below is the change to the 'elsif' statement I made (making it the trinary operator). Thank you again to everybody who responded!

elsif (($cur[2]) > ($sec[2] ? $sec[2] : 0)) { ----------------------------------------------

Hi, I have the following code snipped that generates warnings in places that I cannot find a rhyme or reason for:
135 # new record is the highest 136 print "Begin: i=[$i], cur[2]=[",$cur[2],"], win[2]=[", +$win[2], "]", "\n"; 137 if ($cur[2] > $win[2]) { 138 $top2{$key1}{$key2} = [$votes_office_ttl,@cur,@win] +; 139 } 140 elsif (0+$cur[2] > 0+$sec[2]) { 141 $top2{$key1}{$key2} = [$votes_office_ttl,@win,@cur] +; 142 }; 143 print "End: i=[$i], cur[2]=[",$cur[2],"], win[2]=[", $w +in[2], "]", "\n";
And I get the following warning emitted interleaved with my print statements:
Begin: i=[32], cur[2]=[20], win[2]=[100] Argument "" isn't numeric in addition (+) at ./x.pl line 137, <$fhin> +line 32. End: i=[32], cur[2]=[20], win[2]=[100]
I don't understand why the boolean statement at 137 is being emitted... you can see the values of the variables going into the boolean comparison beforehand. In addition, the 'i' variable is the line number of the source file for the values coming in, and line 32 is the first line that triggers this error. Any ideas?

In reply to Unknown Arithmetic Warning: Cannot determine source by mpettis

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.