First of all, there is an error in the text on page 243 of the text. It is
in regard to MLBDM. The correct code is
my $mary = $hash{mary};
$mary->{email} = 'mary@here';
$hash{mary} = $mary;
The thing that is retrieved from the database is an object, not a
hash. It is necessary to treat it as an object by using the
->
operator to reference a field.
The above is the method for modifying a record that is already in the database.
It is not possible to edit the database directly with a statement
like
$hash{mary}{email} = 'mary@here';
Furthermore, it is not possible to change the entire record to a hash
with a statement like
$hash{mary} = %some_hash;
You will need to use a reference to do this
$hash{mary} = \%some_hash;
If you have done the above and stored the record as a hash, then, to modify
the data in the record, first copy it back to a hash
%some_hash = %{$hash{mary}};
$some_hash{'city'} = 'bedrock';
$some_hash{'pet'} = 'dino';
$hash{mary} = \%some_hash;