Bug 6679 : Don't declare variables in conditionals

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This commit is contained in:
Chris Cormack 2011-11-02 16:24:05 +13:00 committed by Paul Poulain
parent e8ea58270d
commit 21e4d79be8
2 changed files with 17 additions and 10 deletions

View file

@ -118,20 +118,24 @@ my ($input) = @_;
# use Data::Dumper;warn "BIGLOOP IN".Dumper(@BIGLOOP);
}
foreach my $num (sort keys %numbers){
my @tmpcolhdr = @{$numbers{$num}->{'col_hdr'}} if ($numbers{$num}->{'col_hdr'});
my @tmprowhdr = @{$numbers{$num}->{"row_hdr"}} if ($numbers{$num}->{'row_hdr'});
my @tmpcolhdr;
my @tmprowhdr;
@tmpcolhdr = @{$numbers{$num}->{'col_hdr'}} if ($numbers{$num}->{'col_hdr'});
@tmprowhdr = @{$numbers{$num}->{"row_hdr"}} if ($numbers{$num}->{'row_hdr'});
my @lines;
my @lists;
my %BIGLOOPcell;
foreach my $row (@tmprowhdr){
my $tmprowvalue=$row->{rowvalue};
my $rowcode=$1 if $tmprowvalue=~/[0-9]([0-9])\./;
my $rowcode;
$rowcode=$1 if $tmprowvalue=~/[0-9]([0-9])\./;
my @cells;
if (scalar(@tmpcolhdr)>0){
#cas du tableau bidim
foreach my $col (@tmpcolhdr){
my $tmpcolvalue=$col->{colvalue};
my $colcode=$1 if $tmpcolvalue=~/[0-9]\.([0-9])/;
my $colcode;
$colcode=$1 if $tmpcolvalue=~/[0-9]\.([0-9])/;
my %cell;
$cell{celvalue}=$num.$rowcode.$colcode;
$cell{rowvalue}=$tmprowvalue;

View file

@ -1,6 +1,6 @@
#!/usr/bin/perl
# Copyright 2000-2002 Katipo Communications
# Copyright Biblibre 2007
#
# This file is part of Koha.
#
@ -204,12 +204,14 @@ sub plugin {
elsif ( $marcrecord->field('200') ) {
$subfield_value_a = $marcrecord->subfield( '200', 'f' );
}
my $subfield_value_c = $marcrecord->field('210')->subfield("a")
my $subfield_value_c;
my $subfield_value_d;
my $subfield_value_e;
$subfield_value_c = $marcrecord->field('210')->subfield("a")
if ( $marcrecord->field('210') );
my $subfield_value_d = $marcrecord->field('210')->subfield("d")
$subfield_value_d = $marcrecord->field('210')->subfield("d")
if ( $marcrecord->field('210') );
my $subfield_value_e = $marcrecord->field('205')->subfield("a")
$subfield_value_e = $marcrecord->field('205')->subfield("a")
if ( $marcrecord->field('205') );
my $subfield_value_h;
@ -246,7 +248,8 @@ sub plugin {
$subfield_value_i = $marcrecord->field('500')->subfield("i");
}
my $subfield_value_p = $marcrecord->field('215')->subfield("a")
my $subfield_value_p;
$subfield_value_p = $marcrecord->field('215')->subfield("a")
if ( $marcrecord->field('215') );
my $subfield_value_t;