debiandude has asked for the wisdom of the Perl Monks concerning the following question:
What I would like to be able to easily do is add an array of numbers of to say $hash{one}. As example example, in pseudocode:my %hash = ( one => [1,2,4], two => [5,7,9], );
So that, $hash{one} now has the following values: 8, 10, 15. Is there an easy way to do this, or must I loop though the individual elements?$hash{one} += [7,8,11];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Add Array values
by davido (Cardinal) on Dec 29, 2004 at 20:37 UTC | |
by debiandude (Scribe) on Dec 29, 2004 at 21:16 UTC | |
|
Re: Add Array values
by dragonchild (Archbishop) on Dec 29, 2004 at 20:39 UTC | |
|
Re: Add Array values
by duff (Parson) on Dec 30, 2004 at 02:45 UTC | |
|
Re: Add Array values
by Anonymous Monk on Dec 29, 2004 at 22:37 UTC | |
by injunjoel (Priest) on Dec 29, 2004 at 23:16 UTC | |
|
Re: Add Array values
by TedPride (Priest) on Dec 29, 2004 at 21:09 UTC | |
by debiandude (Scribe) on Dec 29, 2004 at 21:16 UTC |