in reply to inner anonymous hash
The perldsc page (dsc -> Data Structures Cookbook) show you how to do that.
Good luck :)