in reply to Re: how to create shared hashes of arrays
in thread how to create shared hashes of arrays

i think i know that its the array reference which is stored in the as the value... i dont think i m facing any problems in that... its only the shared hash which is giving problems...
  • Comment on Re^2: how to create shared hashes of arrays

Replies are listed 'Best First'.
Re^3: how to create shared hashes of arrays
by sumit_nagpal (Initiate) on Jul 09, 2004 at 13:35 UTC
    got it!!! i was trying a few things and this one worked... $my_hash{$key} = &share([]); push(@{$my_hash{$key}},@{$arr_ref}); --Sumit
Re^3: how to create shared hashes of arrays
by Grygonos (Chaplain) on Jul 09, 2004 at 13:35 UTC
    From what I've read the shared hash should be almost no different.. so long as your constructing it correctly.. and what not.. post some sample code so we can see what's going on.
      yes there is difference we can not assign it a reference unless we share that hash location for hash of array $hash{$key} = &share([]) (my case) then we can do ---> $hash{$key} = $arr_ref; for hash of hash $hash{$key} = &share({}) then we can do ----> $hash{$key}{next_key} = "xxx"; Thanks Sumit