Since you're checking $divide_by for a true value (Truth and Falsehood), it's likely that $data_to_sum[0]->[$c] is empty, as LanX pointed out (Update before posting: and as you just discovered yourself). I just wanted to point out tip #4 from the Basic debugging checklist: Use Data::Dumper to see what the variables really contain (although personally I prefer Data::Dump):
use Data::Dump; dd $data_to_sum[0]->[$c], $divide_by; $data_to_sum[0]->[$c] /= $divide_by if $divide_by; print $data_to_sum[0]->[$c], "\n"; __END__ ("", 123) 0
Update: Actually, it turns out that using Data::Dump in this case might confuse the issue more, since it has an issue that causes it to silence the warning in question. So in this case, I recommend Data::Dumper, and I would recommend turning on its Useqq option (as it makes issues with control characters in the string easier to spot):
use Data::Dumper; $Data::Dumper::Useqq=1; print Dumper($data_to_sum[0]->[$c], $divide_by); $data_to_sum[0]->[$c] /= $divide_by if $divide_by; print $data_to_sum[0]->[$c], "\n"; __END__ $VAR1 = ""; $VAR2 = 123; Argument "" isn't numeric in division (/) at ... 0
Update 2019-08-17: Updated the link to "Truth and Falsehood".
In reply to Re: Argument "" isn't numeric in division (updated)
by haukex
in thread Argument "" isn't numeric in division (/)
by seki
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |