R
Ronny
I would like to build a hash, where the keys are strings, and the
values are
references (actually, they are references to anonymous hashes). When I
start like this:
my %uts={};
$uts{X}={};
Perl 5.8.6 complains:
"Reference found where even-sized list expected"
Now I don't question the *content* of this sentence (actually, {} *is*
a reference), but I wonder
why Perl insists in having something like
$uts{X}=();
instead. What is wrong in storing a hash reference in a hash? Other
references (I tried references
to numbers, references to arrays, and code references) work fine.
Ronald
values are
references (actually, they are references to anonymous hashes). When I
start like this:
my %uts={};
$uts{X}={};
Perl 5.8.6 complains:
"Reference found where even-sized list expected"
Now I don't question the *content* of this sentence (actually, {} *is*
a reference), but I wonder
why Perl insists in having something like
$uts{X}=();
instead. What is wrong in storing a hash reference in a hash? Other
references (I tried references
to numbers, references to arrays, and code references) work fine.
Ronald