fix warning
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 11 Apr 2011 17:29:18 +0000 (17:29 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 11 Apr 2011 17:29:18 +0000 (17:29 +0000)
git-svn-id: svn+ssh://mjesec/home/dpavlin/svn/webpac2/trunk@1362 07558da8-63fa-0310-ba24-9fe276d99e06

lib/WebPAC/Normalize/MARC.pm

index b1f0ba6..f2755a7 100644 (file)
@@ -311,7 +311,7 @@ sub marc_fixed {
                        if (length($old) <= $pos) {
                                $_->[1] .= ' ' x ( $pos - length($old) ) . $val;
                                warn "## marc_fixed($f,$pos,'$val') append '$old' -> '$_->[1]'\n" if ($debug > 1);
-                       } else {
+                       } elsif ( defined $old ) {
                                $_->[1] = substr($old, 0, $pos) . $val . substr($old, $pos + length($val));
                                warn "## marc_fixed($f,$pos,'$val') update '$old' -> '$_->[1]'\n" if ($debug > 1);
                        }
@@ -346,6 +346,7 @@ sub marc {
 
        foreach (@_) {
                my $v = $_;             # make var read-write for Encode
+               #Encode::_utf8_on($v); # FIXME we probably need this
                next unless (defined($v) && $v !~ /^\s*$/);
                my ($i1,$i2) = _get_marc_indicators( $f );
                if (defined $sf) {