in reply to Insert a new key (that is a hash) to a hash
Always use strictures (use strict; use warnings; - see The strictures, according to Seuss)! Your sample code fails in at least two different ways under strictures, both of which would have alerted you to errors that are the root of your problem.
my %hashList = {};
Generates the warning: "Reference found where even-sized list expected at ..."
$hashList->{$count} = %secondHash;
Generates the error: "Global symbol "$hashList" requires explicit package name at ..."
|
|---|