From 2633a19b92efab81e79c3ef2e9374bcc4f556c02 Mon Sep 17 00:00:00 2001 From: Mason James Date: Wed, 27 Jun 2012 02:10:11 +1200 Subject: [PATCH] Bug 6679 - [SIGNED-OFF] fix 4 perlcritic violations in C4/ShelfBrowser.pm - Variable declared in conditional statement at line 183, column 5. Declare variables outside of the condition. (Severity: 5) Signed-off-by: Jonathan Druart Signed-off-by: Paul Poulain --- C4/ShelfBrowser.pm | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/C4/ShelfBrowser.pm b/C4/ShelfBrowser.pm index 449190f541..c885d90baf 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, -- 2.39.5