From 84aa094a424c05a874167745a102cde6cc8bb4d5 Mon Sep 17 00:00:00 2001 From: Mason James Date: Wed, 27 Jun 2012 02:10:11 +1200 Subject: [PATCH] Bug 6679 - fix 4 perlcritic violations in C4/ShelfBrowser.pm Content-Type: text/plain; charset="utf-8" http://koha-community.org - Variable declared in conditional statement at line 183, column 5. Declare variables outside of the condition. (Severity: 5) --- C4/ShelfBrowser.pm | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/C4/ShelfBrowser.pm b/C4/ShelfBrowser.pm index 449190f..c885d90 100644 --- a/C4/ShelfBrowser.pm +++ b/C4/ShelfBrowser.pm @@ -180,11 +180,16 @@ sub GetNearbyItems { my @prev_items = reverse GetShelfInfo($sth_prev_items, $marcflavour); my @next_items = GetShelfInfo($sth_next_items, $marcflavour); - my $next_itemnumber = $next_items[-1]->{itemnumber} if @next_items; - my $next_biblionumber = $next_items[-1]->{biblionumber} if @next_items; + my ( + $next_itemnumber, $next_biblionumber, + $prev_itemnumber, $prev_biblionumber + ); + + $next_itemnumber = $next_items[-1]->{itemnumber} if @next_items; + $next_biblionumber = $next_items[-1]->{biblionumber} if @next_items; - my $prev_itemnumber = $prev_items[0]->{itemnumber} if @prev_items; - my $prev_biblionumber = $prev_items[0]->{biblionumber} if @prev_items; + $prev_itemnumber = $prev_items[0]->{itemnumber} if @prev_items; + $prev_biblionumber = $prev_items[0]->{biblionumber} if @prev_items; my %result = ( next => \@next_items, -- 1.7.2.5