Hi, johngg beat me to it, but, I would have said, you could just rename %uniq to %sum and do "increasing/decreasing" inside the loop
You got tricked by your choice of variable name, see Re^4: adding values of element, so I just wanted to emphasize that for you
In reply to Re^3: adding values of element
by Anonymous Monk
in thread adding values of element
by new2perl2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |