Challenge 2: An Array of Hashes — Possible Solution ==================================================================== use strict; use warnings; use feature 'say'; my @products = ( { name => "Widget", price => 19.99 }, { name => "Gadget", price => 34.50 }, { name => "Gizmo", price => 9.95 }, ); foreach my $product (@products) { say "$product->{name}: \$$product->{price}"; } Output: Widget: $19.99 Gadget: $34.50 Gizmo: $9.95 WHY THIS WORKS AS AN ANSWER ------------------------------ Each { name => ..., price => ... } reuses the chapter's own anonymous- hash-reference syntax exactly — curly braces build a brand-new hash reference directly inline, with no separately-declared %hash variable needed for each product, exactly the "standard way real code constructs nested structures" the chapter describes. @products is then a plain array (Chapter 3) whose three elements are each one of those hashrefs — this is the chapter's own "array of hashes" shape, applied to products instead of people. foreach my $product (@products) reuses ordinary array iteration (Chapter 3), and "$product->{name}" inside the interpolated string reuses the chapter's own arrow-dereference syntax to pull the name and price back out of each hashref — this works directly inside double-quoted string interpolation, per Chapter 2's own interpolation rules, without needing to break the expression out of the string first. \$ inside the string is required per Course 1, Chapter 2's own escaping rule — since $ normally triggers interpolation, a literal dollar sign in the output ("$19.99") needs the backslash to print as itself rather than being read as the start of a variable reference.