mpettis has asked for the wisdom of the Perl Monks concerning the following question:
And I get the following warning emitted interleaved with my print statements: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";
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?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]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unknown Arithmetic Warning: Cannot determine source
by ysth (Canon) on Nov 04, 2008 at 05:12 UTC | |
by ikegami (Patriarch) on Nov 04, 2008 at 08:09 UTC | |
by ysth (Canon) on Nov 04, 2008 at 08:20 UTC | |
by ikegami (Patriarch) on Nov 04, 2008 at 08:41 UTC | |
|
Re: Unknown Arithmetic Warning: Cannot determine source
by ig (Vicar) on Nov 04, 2008 at 05:20 UTC | |
|
Re: Unknown Arithmetic Warning: Cannot determine source
by johngg (Canon) on Nov 04, 2008 at 10:46 UTC |