From 7769254190bd7e026f5c69f95384bfa54995a85f Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 4 Nov 2014 09:06:24 +0100 Subject: [PATCH] Bug 11998: QA follow-up - fix the perlcritic error % perlcritic C4/Context.pm Variable declared in conditional statement at line 544, column 5. Declare variables outside of the condition. (Severity: 5) Signed-off-by: Brendan Gallagher --- C4/Context.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C4/Context.pm b/C4/Context.pm index 2a67ed5..0f83467 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -542,7 +542,8 @@ sub preference { my $self = shift; my $var = shift; # The system preference to return - my $cached_var = $syspref_cache->get_from_cache("syspref_$var") if $use_syspref_cache; + my $cached_var; + $cached_var = $syspref_cache->get_from_cache("syspref_$var") if $use_syspref_cache; return $cached_var if defined $cached_var; my $dbh = C4::Context->dbh or return 0; -- 1.7.10.4