[libcatmandu-marc-perl] 116/208: Adding pod

Jonas Smedegaard dr at jones.dk
Sat Oct 28 03:42:42 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 ff3ea0a7cfe86f29adcc93d37af335c2301f3f20
Author: Patrick Hochstenbach <patrick.hochstenbach at ugent.be>
Date:   Mon Mar 6 09:52:30 2017 +0100

    Adding pod
---
 lib/Catmandu/Fix/marc_map.pm |  4 ++++
 t/22-mapping_rules.t         | 12 ++++++++++++
 2 files changed, 16 insertions(+)

diff --git a/lib/Catmandu/Fix/marc_map.pm b/lib/Catmandu/Fix/marc_map.pm
index 005f4ba..97d0317 100644
--- a/lib/Catmandu/Fix/marc_map.pm
+++ b/lib/Catmandu/Fix/marc_map.pm
@@ -147,6 +147,10 @@ The MARC_PATH can point to one or more MARC subfields. For instamce:
     marc_path('245a',title)
     marc_path('245ac',title)
 
+You can also use dollar signs to indicate subfields
+
+    marc_path('245$a$c',title)
+
 Wildcards are allowed in the field names:
 
     # Map all the 200-fields to a title
diff --git a/t/22-mapping_rules.t b/t/22-mapping_rules.t
index 2a9c4b9..2ff7bc3 100644
--- a/t/22-mapping_rules.t
+++ b/t/22-mapping_rules.t
@@ -85,6 +85,18 @@ note 'marc_map(245ac,title)    title: "Title / Name"';
     is_deeply $record->{title}, 'Title / Name', 'marc_map(245ac,title)';
 }
 
+note 'marc_map(245$a$c,title)    title: "Title / Name"';
+{
+    my $importer = Catmandu->importer(
+        'MARC',
+        file => \$mrc,
+        type => 'XML',
+        fix  => 'marc_map(245$a$c,title); retain_field(title)'
+    );
+    my $record = $importer->first;
+    is_deeply $record->{title}, 'Title / Name', 'marc_map(245$a$c,title)';
+}
+
 note 'marc_map(245ca,title)    title: "Title / Name"';
 {
     my $importer = Catmandu->importer(

-- 
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