Skip to content

Commit

Permalink
fix issues found by Perl::Critic::Freenode
Browse files Browse the repository at this point in the history
  • Loading branch information
Grinnz committed Aug 11, 2017
1 parent 78eeeef commit 4bad51b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
10 changes: 5 additions & 5 deletions lib/Module/Starter/App.pm
Expand Up @@ -33,16 +33,16 @@ sub _config_read {
my $self = shift;

my $filename = $self->_config_file;
return unless -e $filename;
return () unless -e $filename;

open( my $config_file, '<', $filename )
or die "couldn't open config file $filename: $!\n";

my %config;
while (<$config_file>) {
chomp;
next if /\A\s*\Z/sm;
if (/\A(\w+):\s*(.+)\Z/sm) { $config{$1} = $2; }
while (my $line = <$config_file>) {
chomp $line;
next if $line =~ /\A\s*\Z/sm;
if ($line =~ /\A(\w+):\s*(.+)\Z/sm) { $config{$1} = $2; }
}

return $self->_config_multi_process(%config);
Expand Down
2 changes: 1 addition & 1 deletion lib/Module/Starter/BuilderSet.pm
Expand Up @@ -111,7 +111,7 @@ sub _builder {

unless (exists $self->{$builder}) {
carp("Don't know anything about builder '$builder'.");
return;
return undef;
}

return $self->{$builder};
Expand Down
4 changes: 2 additions & 2 deletions lib/Module/Starter/Simple.pm
Expand Up @@ -1212,7 +1212,7 @@ EOH
$module_boilerplate_tests .=
" module_boilerplate_ok('".$self->_module_to_pm_file($_)."');\n" for @modules;

my $boilerplate_tests = @modules + 2 + $[;
my $boilerplate_tests = @modules + 2;
$xt_files{'boilerplate.t'} = $header.<<"HERE";
plan tests => $boilerplate_tests;
Expand Down Expand Up @@ -1722,7 +1722,7 @@ You can find documentation for this module with the perldoc command.
];
my @reference_links = _reference_links();

return unless @reference_links;
return undef unless @reference_links;
$content .= qq[
You can also look for information at:
Expand Down
6 changes: 4 additions & 2 deletions t/module-starter.t
Expand Up @@ -126,7 +126,8 @@ sub check_generated_files {
my %generated_files = generated_files($opts);

my $all_files_correct = 1;
while (my($k,$v) = each %generated_files) {
foreach my $k (keys %generated_files) {
my $v = $generated_files{$k};
if ($v eq 'f') {
$all_files_correct = 0 unless -f $k;
} elsif ($v eq 'd') {
Expand Down Expand Up @@ -276,7 +277,8 @@ sub run_module_starter {
my $command = $module_starter;
my @option_string = ("");

while(my($k,$v) = each(%opts)){
foreach my $k (keys %opts) {
my $v = $opts{$k};
if( ref $v eq 'ARRAY' &&
int( @$v ) > 1
){
Expand Down
2 changes: 1 addition & 1 deletion t/test-dist.t
Expand Up @@ -1328,7 +1328,7 @@ sub rstr_module {
while ($str[0] =~ /^\d+/) {
$str[0] =~ s/^\d+//;
shift @str unless ($str[0]);
return &rstr_module unless (@str);
return rstr_module() unless (@str);
}

return join('::', @str);
Expand Down

0 comments on commit 4bad51b

Please sign in to comment.