Challenge 2: Named Captures for a Date — Possible Solution ==================================================================== use strict; use warnings; use feature 'say'; my $date = "2026-07-10"; if ($date =~ /(?\d{4})-(?\d{2})-(?\d{2})/) { say "Year: $+{year}, Month: $+{month}, Day: $+{day}"; } Output: Year: 2026, Month: 07, Day: 10 WHY THIS WORKS AS AN ANSWER ------------------------------ (?\d{4}), (?\d{2}), and (?\d{2}) each reuse the chapter's own named-capture syntax exactly — (?...) — applied to three separate groups instead of the chapter's own date/level/ message log-line example, with \d{4} and \d{2} reused directly from Course 1's regex quantifier syntax to match exactly 4 and 2 digits respectively. $+{year}, $+{month}, and $+{day} reuse the chapter's own %+ hash access pattern precisely — each named group's captured text becomes retrievable by name through this special hash, immediately after a successful match, with no need to track which numbered $1/$2/$3 position corresponds to which piece of the date. Interpolating all three directly inside one double-quoted string, "Year: $+{year}, Month: $+{month}, Day: $+{day}", reuses ordinary string interpolation (Course 1, Chapter 2) — hash-element access interpolates inside double quotes exactly like a plain scalar variable does, producing the full formatted sentence the challenge asks for in a single say call.