use 5.38.0; package Part2; use Part1; use List::AllUtils qw/ min product sum /; sub solution_2 ($input) { sum map { product $_->@{qw/ red blue green /}} map { Part1::aggregate_entries($_) } map { Part1::parse_line($_)} split "\n", $input; } 1;