How to deal with hashes of hashes

In the following pages we'll cover topics regarding the using of Perl hashes of hashes, grouped in two parts, as follows:

Part 1:

  • How to generate a hash of hashes
  • How to use for to traverse and print a hash of hashes
  • How to use foreach to traverse and print a hash of hashes
  • How to use grep to traverse and filter a hash of hashes
  • How to use map to traverse a hash of hashes
  • How to use while to traverse a hash of hashes
  • How to access or modify an inner hash element
  • How to add another anonymous hash to a hash of hashes
  • How to represent a matrix as a hash of hashes
  • How to find the length of a hash of hashes

Part 2:

  • How to count the occurrences of a particular value in all inner hashes
  • How to get and sort the values associated with a specific key in the inner hashes
  • How to sort a hash of hashes
  • How to delete an entry from an inner hash
  • How to delete a specific entry of a hash of hashes
  • How to clear a hash of hashes
  • How to copy a hash of hashes – shallow vs deep
  • How to pass a hash of hashes reference to a subroutine
  • How to deal with autovivification in a hash of hashes

Use the menu items from the right side to access these topics.