From 8a22380ad43a52a1894840d348e8becb03373ec1 Mon Sep 17 00:00:00 2001 From: Mason James Date: Wed, 27 Jun 2012 02:55:44 +1200 Subject: [PATCH] Bug 6679 - fix 3 perlcritic violations in C4/ClassSortRoutine.pm Content-Type: text/plain; charset="utf-8" http://koha-community.org Expression form of "eval" at line 55, column 9. See page 161 of PBP. (Severity: 5) Expression form of "eval" at line 57, column 9. See page 161 of PBP. (Severity: 5) Expression form of "eval" at line 58, column 13. See page 161 of PBP. (Severity: 5) --- C4/ClassSortRoutine.pm | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/C4/ClassSortRoutine.pm b/C4/ClassSortRoutine.pm index 04c24a5..f97add4 100644 --- a/C4/ClassSortRoutine.pm +++ b/C4/ClassSortRoutine.pm @@ -52,10 +52,10 @@ use C4::ClassSortRoutine; my %loaded_routines = (); my @sort_routines = GetSortRoutineNames(); foreach my $sort_routine (@sort_routines) { - if (eval "require C4::ClassSortRoutine::$sort_routine") { + if (eval {require C4::ClassSortRoutine::$sort_routine}) { my $ref; - eval "\$ref = \\\&C4::ClassSortRoutine::${sort_routine}::get_class_sort_key"; - if (eval "\$ref->(\"a\", \"b\")") { + eval {\$ref = \\\&C4::ClassSortRoutine::${sort_routine}::get_class_sort_key}; + if (eval { \$ref->(\"a\", \"b\")} ) { $loaded_routines{$sort_routine} = $ref; } else { $loaded_routines{$sort_routine} = \&_get_class_sort_key; -- 1.7.2.5