From 5dd1b1bb66b12f9c91522631ff97661f7d38d568 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Sat, 21 May 2016 10:20:55 +0100 Subject: [PATCH] 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 --- misc/migration_tools/rebuild_zebra.pl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 )); } -- 2.39.5