App-LogStats
view release on metacpan or search on metacpan
lib/App/LogStats.pm view on Meta::CPAN
$self->_show_usage(1);
},
'v|version' => sub {
print "stats v$App::LogStats::VERSION\n";
exit 1;
},
) or $self->_show_usage(2);
push @{$config->{file}}, @{$argv};
$self->_validate_config($config);
}
sub _show_usage {
my ($self, $exitval) = @_;
require Pod::Usage;
Pod::Usage::pod2usage($exitval);
}
sub _validate_config {
my ($self, $config) = @_;
if (!$config->{digit} || $config->{digit} !~ m!^\d+$!) {
$config->{digit} = 2;
}
$config->{delimiter} = "\t" unless defined $config->{delimiter};
if ($config->{fields}) {
for my $f ( split ',', $config->{fields} ) {
( run in 0.234 second using v1.01-cache-2.11-cpan-4d50c553e7e )