Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Now I want to add a string at the end of the elements which belongs to the key. So at the end of the elements of key1, there should be a specific string. like this:%hash{@key1} => [@array1, @array2, etc]; %hash{@key2} => [@array1, @array2, etc.];
I tried it so far with this, but it did not work as expected.%hash{@key1} => [@array1, @array2, "abc"]; %hash{@key2} => [@array1, @array2, "abc"];
I hope someone could help me! Regards sandoradopush (@{$hash{$key}}, (@array1, "abc"));
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: add element to hash
by Athanasius (Archbishop) on Sep 01, 2014 at 07:43 UTC | |
by Anonymous Monk on Sep 01, 2014 at 08:01 UTC | |
by roboticus (Chancellor) on Sep 01, 2014 at 11:28 UTC | |
by NetWallah (Canon) on Sep 01, 2014 at 14:31 UTC | |
|
Re: add element to hash
by LanX (Saint) on Sep 01, 2014 at 11:59 UTC |