From e6282f66cacfd04e7fe9280b118d28f0c824007f Mon Sep 17 00:00:00 2001 From: Mason James Date: Wed, 27 Jun 2012 05:07:46 +1200 Subject: [PATCH] Bug 6679 - [SIGNED-OFF] fix 2 perlcritic violations in C4/Installer/PerlModules.pm MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Expression form of "eval" at line 71, column 9. See page 161 of PBP. (Severity: 5) Expression form of "eval" at line 85, column 13. See page 161 of PBP. (Severity: 5) Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall Signed-off-by: Mark Tompsett Signed-off-by: Kyle M Hall Signed-off-by: Brendan A Gallagher (cherry picked from commit 0e356b214eb049a446a8d089d579775aa49287d7) Signed-off-by: Julian Maurice (cherry picked from commit f8bd7e717927c65782f544ee0b5a3ec38a3330ad) Signed-off-by: Frédéric Demians --- C4/Installer/PerlModules.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Installer/PerlModules.pm b/C4/Installer/PerlModules.pm index 2f40cf559f..655db74b34 100644 --- a/C4/Installer/PerlModules.pm +++ b/C4/Installer/PerlModules.pm @@ -68,7 +68,7 @@ sub version_info { my %params = @_; if ($params{'module'}) { return -1 unless grep {m/$params{'module'}/} keys(%$PERL_DEPS); - eval "require $params{'module'}"; + eval {require $params{'module'}}; if ($@) { return {$params{'module'} => {cur_ver => 0, min_ver => $PERL_DEPS->{$_}->{'min_ver'}, upgrade => 0, required => $PERL_DEPS->{$_}->{'required'}, usage => $PERL_DEPS->{$_}->{'usage'}}}; } @@ -82,7 +82,7 @@ sub version_info { else { for (sort keys(%{$PERL_DEPS})) { my $pkg = $_; # $_ holds the string - eval "require $pkg"; + eval {require $pkg}; if ($@) { push (@{$self->{'missing_pm'}}, {$_ => {cur_ver => 0, min_ver => $PERL_DEPS->{$_}->{'min_ver'}, required => $PERL_DEPS->{$_}->{'required'}, usage => $PERL_DEPS->{$_}->{'usage'}}}); } -- 2.39.5