Hello sandorado,
...it did not work as expected isn’t a very helpful error description. The following is a guess at what you are trying to do:
#! perl use strict; use warnings; use Data::Dump; my @array1 = qw( a e i o u ); my @array2 = qw( x y z ); my %hash = ( key1 => [ \@array1, \@array2, ], ); dd \%hash; push @{ $hash{key1} }, 'abc'; dd \%hash;
Output:
17:39 >perl 994_SoPW.pl { key1 => [["a", "e", "i", "o", "u"], ["x", "y", "z"]] } { key1 => [["a", "e", "i", "o", "u"], ["x", "y", "z"], "abc"] } 17:39 >
If I’ve guessed wrong, you will need to clarify your question.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
In reply to Re: add element to hash
by Athanasius
in thread add element to hash
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |