How to deal with arrays of hashes

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

Part 1:

  • How to use while and push to generate an array of hashes
  • How to use for to traverse and print an array of hashes
  • How to use foreach to traverse and print an array of hashes
  • How to use grep to traverse and filter an array of hashes
  • How to use map and join to traverse and print an array of hashes
  • How to use while to traverse and print an array of hashes
  • How to access or modify the inner hashes elements
  • How to get an inner hash when a certain condition is met
  • How to extract the keys from an array of hashes
  • How to sort an array of hashes

Part 2:

  • How to remove the first element of an array of hashes
  • How to remove the last element of an array of hashes
  • How to delete a particular inner hash entry
  • How to clear the array of hashes
  • How to insert an element at the first position of an array of hashes
  • How to append an element to an array of hashes
  • How to replace or remove a contiguous range of elements in an array of hashes
  • How to copy an array of hashes – shallow vs deep
  • How to pass an array of hashes reference to a subroutine
  • How to deal with autovivification in an array of hashes

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