[libcatmandu-marc-perl] 94/208: Fixing error in split/pluck

Jonas Smedegaard dr at jones.dk
Sat Oct 28 03:42:39 UTC 2017


This is an automated email from the git hooks/post-receive script.

js pushed a commit to annotated tag upstream/1.19
in repository libcatmandu-marc-perl.

commit d9db0e563c8766d5c88e54272b32c6d73f0b3d9e
Author: Patrick Hochstenbach <patrick.hochstenbach at ugent.be>
Date:   Tue Feb 28 10:53:14 2017 +0100

    Fixing error in split/pluck
---
 Build.PL             | 2 +-
 cpanfile             | 2 +-
 lib/Catmandu/MARC.pm | 5 +++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/Build.PL b/Build.PL
index 3c3999e..49e3933 100644
--- a/Build.PL
+++ b/Build.PL
@@ -34,7 +34,7 @@ my %module_build_args = (
     "MARC::Lint" => 0,
     "MARC::Parser::RAW" => 0,
     "MARC::Record" => "v2.0.6",
-    "MARC::Spec" => 0,
+    "MARC::Spec" => "v0.1.0",
     "Memoize" => 0,
     "Moo" => "1.0",
     "MooX::Singleton" => 0,
diff --git a/cpanfile b/cpanfile
index a9873a3..9aa896b 100644
--- a/cpanfile
+++ b/cpanfile
@@ -22,7 +22,7 @@ requires 'MARC::Record', '2.0.6';
 requires 'MARC::Lint', '0';
 requires 'MARC::Parser::RAW', '0';
 requires 'Const::Fast', '0.014';
-requires 'MARC::Spec';
+requires 'MARC::Spec', '0.1.0';
 requires 'Memoize', '0';
 requires 'Moo', '1.0';
 requires 'MooX::Singleton', '0';
diff --git a/lib/Catmandu/MARC.pm b/lib/Catmandu/MARC.pm
index 9895d65..a164553 100644
--- a/lib/Catmandu/MARC.pm
+++ b/lib/Catmandu/MARC.pm
@@ -71,9 +71,10 @@ sub marc_map {
                     push @{ $_h->{ $field->[$i] } } , $field->[$i + 1];
                 }
                 my $subfield = $context->{subfield};
-                $subfield =~ s{^[a-zA-Z0-9]}{}g;
+                $subfield =~ s{[^a-zA-Z0-9]}{}g;
                 for my $c (split('',$subfield)) {
-                    push @$v , @{ $_h->{$c} } if exists $_h->{$c};
+                    my $val = $_h->{$c} // [undef];
+                    push @$v , @{ $val } ;
                 }
             }
             else {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcatmandu-marc-perl.git



More information about the Pkg-perl-cvs-commits mailing list