... } else { if ($currentGoal == $nextValue) { print join(',', @$included, $nextValue), "\n"; push @results, [@$included, $nextValue]; } return if $nextValue >= $currentGoal; } ...