Challenge 2: Filter and Transform — Possible Solution ==================================================================== use strict; use warnings; use feature 'say'; my @numbers = (1..10); my @big = grep { $_ > 5 } @numbers; my @doubled = map { $_ * 2 } @big; say "@doubled"; Output: 12 14 16 18 20 WHY THIS WORKS AS AN ANSWER ------------------------------ my @numbers = (1..10); reuses the range operator from Course 1's own loop-range coverage to build the list 1 through 10 in one expression. grep { $_ > 5 } @numbers reuses the chapter's own grep filtering pattern exactly — $_ (the implicit topic variable) is set to each number in turn, and only numbers where $_ > 5 is true survive, producing (6, 7, 8, 9, 10), matching the chapter's own description of grep as "keeps only the elements where the block evaluates true." map { $_ * 2 } @big reuses the chapter's own map transformation pattern directly, applied to the already-filtered @big list rather than the original @numbers — doubling each of the five remaining numbers produces (12, 14, 16, 18, 20). Doing this as two separate steps (grep first, into @big, then map into @doubled) rather than one chained pipeline keeps each step's result independently inspectable, though the chapter's own chained map/grep/sort pipeline shows this same two-step logic can also be written as a single expression once each individual piece is comfortable on its own.