in reply to References on hashes!

In your code, within 'add' sub, %temp is a local hash and it doesn't modify the passed reference for the main program.
--Artist