Now when I print out the values for both 'obj1' or 'obj2' I get values from both. Am I doing anything wrong? I thought I would only get values contained under the particular one I wantfor($i=1;$i<4;$i++) { push(@{$test{obj1}{values}},$i); } for($i=4;$i<7;$i++) { push(@{$test{obj2}{values}},$i); }
Thanks, desperate soulforeach $key (keys %test) { foreach $tmpvalue (@{$test{$key}{value}) { print "$key --> $tmpvalue\n"; } } Output: obj1 --> 0 obj1 --> 1 obj1 --> 2 obj1 --> 3 obj1 --> 4 obj1 --> 5 obj1 --> 6 . . .
In reply to Hash of arrays by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |