App-Project-Doctor
view release on metacpan or search on metacpan
lib/App/Project/Doctor/Fixer.pm view on Meta::CPAN
my %seen;
# Parse the numbers, clamp to valid range, and deduplicate.
my @indices = grep { $_ >= 1 && $_ <= $max && !$seen{$_}++ }
map { int($_) }
split /[\s,]+/, $answer;
# Convert 1-based user indices to 0-based array indices.
my @selected = map { $fixable->[$_ - 1] } @indices;
return $self->_apply_all(\@selected);
}
# Anything else is unrecognised; be explicit rather than guessing.
print "Unrecognised input -- no fixes applied.\n";
return 0;
}
# Purpose: Call every fix coderef in the list and count the successes.
# Entry: $fixable is an arrayref of Finding objects (may be empty).
# Exit: Integer count of fixes that ran without throwing.
# Side effects: Calls fix coderefs (may create/modify files), writes to STDOUT on
# success, calls carp for each failing fix.
sub _apply_all {
( run in 1.070 second using v1.01-cache-2.11-cpan-7fcb06a456a )