in reply to Re: In a hash with hashes
in thread In a hash with hashes
Since BrowserUk has already provided the answer, this reply is very much BTW, but FWIW...
In the OPed code fragment, the statement
$practice->{$patient->{suregery_id}} = \$patient;
repeatedly assigns (i.e., overwrites) a reference to $patient to the hash key $patient->{suregery_id} of the hash referenced by $practice.
The OPed code iterates over an array of hash references, so $patient is already a hash reference. The statement above repeatedly assigns the LHS hash element a reference to a reference to a hash, which is probably even less what weezer_316 wanted! (Again, not that it matters much at this point.)
|
|---|