in reply to Adding value to hash

I guess you're using $temp_hash as a scalar somewhere, but think you're using as a hash...

The error is produced because you've probably got.

use strict;
at the top of your script (which is good). This is forcing you to declare your variables with "my".

Now you HAVE declared the HASH %temp_hash, but you HAVEN'T declared the SCALAR $temp_hash.

The lines you posted look fine, the error must be on another line, or you've made changes to your example.

Updated: to slightly less fractured english

---
my name's not Keith, and I'm not reasonable.