I still don't get it. That code snippet sets the hash entry at $k to two times what's in $value. It still seems to me that you're not seeing that you can use a += operator on a hash element. What am I missing?
foreach (@temp) { my ($instan, $value) = (split /\*/, $_); my $k = $key . ":" . $instan; $DM_D{$k} += $value; # Change this line maybe??? }
In reply to Re: Re: Re: How can I add the values of a hash?
by steves
in thread How can I add the values of a hash?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |