in reply to Uninitialized value in division and Illegal division by zero fix
Well, you never populate %total_mono in any way (in the code you posted). Therefore, $total_mono{$k} is undefined, no matter what $k contains. And an undefined value is interpreted as zero in a numeric context, and division by zero does not work, of course (see Meaning Of error in perl for a recent discussion).
It's impossible to say how to proceed from here without knowing more about what you want to accomplish.
Also, some general notes:
Here are some more resources on how to ask questions effectively:
Please help us help you. Thanks!
|
|---|