http://www.perlmonks.org?node_id=1009496


in reply to Can't modify int in scalar assignment error

If you "use strict;" in your program, it would have told you:
Global symbol "@accums" requires explicit package name at ..
which identifies the problem immediately, in your "foreach(@accums)" line.

Poor programming practices precurse pernicious predicament.

             "By three methods we may learn wisdom: First, by reflection, which is noblest; Second, by imitation, which is easiest; and third by experience, which is the bitterest."           -Confucius