diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2020-01-14 15:07:52 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2020-01-14 15:07:52 +0200 |
commit | 54204eceb2ae19a0ec9f86f65d8f0fe44569f518 (patch) | |
tree | c4f775346be47f04d73a477c8ea166cb7e9e7f9b | |
parent | 6462707df92c153e78434d98a1b735fcd2fba7af (diff) | |
download | acmeman-54204eceb2ae19a0ec9f86f65d8f0fe44569f518.tar.gz acmeman-54204eceb2ae19a0ec9f86f65d8f0fe44569f518.tar.bz2 |
Minor changes
-rw-r--r-- | lib/App/Acmeman/Apache/Layout.pm | 4 | ||||
-rw-r--r-- | lib/App/Acmeman/Source/Default.pm | 5 |
2 files changed, 3 insertions, 6 deletions
diff --git a/lib/App/Acmeman/Apache/Layout.pm b/lib/App/Acmeman/Apache/Layout.pm index 5c6d191..c4b47ad 100644 --- a/lib/App/Acmeman/Apache/Layout.pm +++ b/lib/App/Acmeman/Apache/Layout.pm @@ -88,9 +88,7 @@ sub detect { foreach my $mod ($class->modules) { debug(3, "trying layout module $mod"); - my $obj; - eval { $obj = $mod->new($ap) }; - if ($obj) { + if (my $obj = eval { $mod->new($ap) }) { return $obj; } if ($@) { diff --git a/lib/App/Acmeman/Source/Default.pm b/lib/App/Acmeman/Source/Default.pm index 9f9bd86..306a867 100644 --- a/lib/App/Acmeman/Source/Default.pm +++ b/lib/App/Acmeman/Source/Default.pm @@ -4,11 +4,10 @@ use warnings; use parent 'App::Acmeman::Source'; sub new { - my $self; shift; # Skip class name. - eval { + my $self = eval { require App::Acmeman::Source::Apache; - $self = new App::Acmeman::Source::Apache(@_); + new App::Acmeman::Source::Apache(@_); }; if ($@) { (my $s = $@) =~ s{ at /.+$}{}; |