$key = 'd';
$value = 4;
$hash{$key} = $value;
That's all you need to do.
Update:
Just wanted to say that hashes can be used for so many different things, internal (e.g. %ENV, %INC, %main) and external, in perl; you will want to master them. If you're not getting enough from the 'camel' book, try the Black Book and
perldoc -q hash.