in reply to Can't modify int in scalar assignment error
which identifies the problem immediately, in your "foreach(@accums)" line.Global symbol "@accums" requires explicit package name at ..
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