in reply to Re^2: hash question
in thread hash question
You are missing one slight catch. When you do
you get pointer to the object passed to the function. When you domy $hash = shift;
you create new object and store its pointer in the variable that previously contained pointer to another object. Finally, when you do$hash = {a => "alpha"};
then you take object pointed by the variable and store in that object new set of keys.%{ $hash } = ( a => 'alpha', b => 'beta' );
You have to distinguish "objects" and "pointers to objects", the latter are called "references" in perl, then things may become more consistent for you.
|
|---|