in reply to how do I use a hash of hashes reference in a function ?

$hashref{name}={data1=>"moredata",};
Wrong syntax for adding to a hash. Use this:
$hashref{name}{data1} = "moredata";

Replies are listed 'Best First'.
RE: Answer: how do I use a hash of hashes reference in a function ?
by Fastolfe (Vicar) on Sep 22, 2000 at 23:45 UTC
    Just for clarification (for the original poster), your syntax:
    $hashref{name} = { data1 => "moredata" };
    *replaces* the reference in $hashref{name} with a new one, composed of your data1 => "moredata" hash. That's why it won't work. merlyn is correct in that if you wish to modify the hash referenced by $hashref{name} you don't do that by setting $hashref{name}, you modify it as if it were a hash: $hashref{key}{subkey} = $xyz;