Challenge 1: An Independent Counter Pair — Possible Solution ==================================================================== use strict; use warnings; use feature 'say'; sub make_counter { my $count = 0; return sub { return ++$count; }; } my $counter_a = make_counter(); my $counter_b = make_counter(); $counter_a->(); $counter_a->(); $counter_a->(); $counter_b->(); say $counter_a->(); # calling a 4th time to check the current value say $counter_b->(); # calling a 2nd time to check the current value Output: 4 2 WHY THIS WORKS AS AN ANSWER ------------------------------ make_counter is reused completely unchanged from the chapter's own example — each call builds a fresh $count lexical and returns an anonymous sub that closes over that specific variable. my $counter_a = make_counter(); and my $counter_b = make_counter(); each invoke make_counter() SEPARATELY, meaning each call creates its own independent $count — reusing the chapter's own explanation that "each call to make_counter() creates a genuinely fresh $count," so $counter_a and $counter_b, despite being built from identical code, never share state. Calling $counter_a->() three times advances ITS $count to 3, then a fourth call (used here to both advance and print in one step) brings it to 4. Calling $counter_b->() once advances its own, completely separate $count to 1, and a second call brings it to 2. The two final printed values, 4 and 2, directly confirm the counters never interfered with each other — exactly the independence the chapter's own $counter1/$counter2 example demonstrates.