Perh Hash of Hash of Array structure



I am programing with a hash structure for a cache. The code is below.
The part dont understand, is that in the output why does "'prefix4' =>
$VAR2->{'key2'}{'key3'}{'class'}{'prefix5'}," show up unlike an array.
All the others show up as arrays but not this one. Does this mean that
i am making a wrong assignment? Is my code bad in the assignments? Or
is it just a display problem with the Data::Dumper module?

Thanks for any suggestions



=CODE=====================================
use strict;
use warnings;
use Data::Dumper;

my %acctMap=();

my @r = ( "fred", "barney", "pebbles", "bamm bamm", "dino" );

%{$acctMap{'key1'}{'key2'}{'key3'}{'class'}} = (
prefix1 => [ "george1", "jane2", "el3roy" ],
prefix2 => [ "george", "jane", "elroy" ],
prefix3 => [ "george", "jane", "elroy" ],
);

$acctMap{'key1'}{'key2'}{'key3'}{'class'}{'prefix4'} = \@r;
$acctMap{'key1'}{'key2'}{'key3'}{'class'}{'prefix5'} = \@r;
$acctMap{'key1'}{'key2'}{'key3'}{'class'}{'prefix6'} = \@r;

print Dumper(%acctMap);

exit;

=CODE=====================================



=OUTPUT=====================================
$VAR1 = 'key1';
$VAR2 = {
'key2' => {
'key3' => {
'class' => {
'prefix5' => [
'fred',

'barney',

'pebbles',
'bamm
bamm',
'dino'
],
'prefix6' => $VAR2-
{'key2'}{'key3'}{'class'}{'prefix5'},
'prefix4' => $VAR2-
{'key2'}{'key3'}{'class'}{'prefix5'},
'prefix1' => [

'george1',
'jane2',
'el3roy'
],
'prefix3' => [

'george',
'jane',
'elroy'
],
'prefix2' => [

'george',
'jane',
'elroy'
]
}
}
}
};
=OUTPUT=====================================

.



Relevant Pages

  • Re: array lines shifting
    ... What is it ment to do? ... This is your array: ... What is the goal, the goal is, to rotate array rows, the ... There is an assignment to stored value ...
    (alt.comp.lang.learn.c-cpp)
  • Re: undefined vs. undefined (was: new Array() vs [])
    ... or to the array performance, I dared to move it to a new thread. ... And section 10.1.3 explains the assignment of the undefined value to ... to give a Reference type. ... var arr = ...
    (comp.lang.javascript)
  • Re: array lines shifting
    ... What is it ment to do? ... This is your array: ... What is the goal, the goal is, to rotate array rows, the ... There is an assignment to stored value ...
    (alt.comp.lang.learn.c-cpp)
  • Re: undefined vs. undefined (was: new Array() vs [])
    ... object, object property, array, array space, array member ... Wherever whenever we had an assignment then we ... for (var prop in arr) { ...
    (comp.lang.javascript)
  • Re: malloc creates seg faults?
    ... > Larry Brasfield wrote: ... Assignment should only be done to ... >> then you need to use placement new to get the Product ... The size of the array is not known beforehand, and as far as I know, new doesn't accept variables. ...
    (comp.lang.cpp)