in reply to Hash handling error

Sorry, I just have a second to spend on this. If I understood correctly, somewhere you have

$href->{$k} = $v;
where you want
push @{ $href->{$k} }, $v;
which is short for
push @{ $href->{$k} ||= [] }, $v;