[libcatmandu-marc-perl] 06/208: Adding inline support for value options

Jonas Smedegaard dr at jones.dk
Sat Oct 28 03:42:29 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 42aee91c6b7c3c71371efc07fbbbef956dcb656b
Author: Patrick Hochstenbach <patrick.hochstenbach at ugent.be>
Date:   Mon Jun 13 14:36:05 2016 +0200

    Adding inline support for value options
---
 Changes                             | 1 +
 lib/Catmandu/Fix/Inline/marc_map.pm | 3 +++
 lib/Catmandu/Fix/marc_map.pm        | 3 +++
 3 files changed, 7 insertions(+)

diff --git a/Changes b/Changes
index 86d7915..6a772e3 100644
--- a/Changes
+++ b/Changes
@@ -3,6 +3,7 @@ Revision history for Catmandu-MARC
 {{$NEXT}}
   - Fixed indicator-2 selection bug
   - Fixed marc_map value bug
+  - Support for the value in the inline fixes
   
 0.215  2016-02-22 09:57:07 CET
   - Supporting ISO alias for USMARC importer and exporter
diff --git a/lib/Catmandu/Fix/Inline/marc_map.pm b/lib/Catmandu/Fix/Inline/marc_map.pm
index cfb1245..808b372 100644
--- a/lib/Catmandu/Fix/Inline/marc_map.pm
+++ b/lib/Catmandu/Fix/Inline/marc_map.pm
@@ -30,6 +30,9 @@ Catmandu::Fix::Inline::marc_map - A marc_map-er for Perl scripts
  # Get all 100 subfields except the digits
  $str = marc_map($data,'100^0123456789');
 
+ # If the 260c exist set the output to 'OK' (else undef)
+ $ok  = marc_map($data,'260c',-value => 'OK');
+
  # The $data should be a Catmandu-style MARC hash
  { record => [
     ['field', 'ind1' , 'ind2' , 'subfieldcode or underscore' , 'data' , 'subfield' , 'data' , ...] ,
diff --git a/lib/Catmandu/Fix/marc_map.pm b/lib/Catmandu/Fix/marc_map.pm
index e2891ac..515118b 100644
--- a/lib/Catmandu/Fix/marc_map.pm
+++ b/lib/Catmandu/Fix/marc_map.pm
@@ -180,6 +180,9 @@ Catmandu::Fix::marc_map - copy marc values of one field to a new field
     # When 024 field exists create the my.has024 hash with value 'found'
     marc_map('024','my.has024', value:found)
 
+    # When 260c field exists create the my.has260c hash with value 'found'
+    marc_map('260c','my.has260c', value:found)
+
     # Do the same examples now with the marc fields in 'record2'
     marc_map('245','my.title', record:record2)
 

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