From: Jonathan Druart Date: Sat, 21 May 2016 09:20:55 +0000 (+0100) Subject: Bug 16506: Remove warning for UNIMARC installs X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=5dd1b1bb66b12f9c91522631ff97661f7d38d568;p=koha.git Bug 16506: Remove warning for UNIMARC installs Use of uninitialized value in numeric eq (==) Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall --- diff --git a/misc/migration_tools/rebuild_zebra.pl b/misc/migration_tools/rebuild_zebra.pl index 3a0fe6dac3..6c036bad9d 100755 --- a/misc/migration_tools/rebuild_zebra.pl +++ b/misc/migration_tools/rebuild_zebra.pl @@ -782,7 +782,8 @@ sub fix_unimarc_100 { my $marc = shift; my $string; - if ( length($marc->subfield( 100, "a" )) == 36 ) { + my $length_100a = length($marc->subfield( 100, "a" )); + if ( $length_100a and $length_100a == 36 ) { $string = $marc->subfield( 100, "a" ); my $f100 = $marc->field(100); $marc->delete_field($f100); @@ -793,7 +794,8 @@ sub fix_unimarc_100 { $string = sprintf( "%-*s", 35, $string ); } substr( $string, 22, 6, "frey50" ); - unless ( length($marc->subfield( 100, "a" )) == 36 ) { + $length_100a = length($marc->subfield( 100, "a" )); + unless ( $length_100a and $length_100a == 36 ) { $marc->delete_field($marc->field(100)); $marc->insert_grouped_field(MARC::Field->new( 100, "", "", "a" => $string )); }