[libcatmandu-marc-perl] 169/208: Updating README

Jonas Smedegaard dr at jones.dk
Sat Oct 28 03:42:47 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 68b9f458bb8ee0bb9e2eacb5ac7fa1b040299517
Author: Patrick Hochstenbach <patrick.hochstenbach at ugent.be>
Date:   Thu Jun 29 16:17:42 2017 +0200

    Updating README
---
 README.md            |  2 ++
 lib/Catmandu/MARC.pm | 57 ----------------------------------------------------
 2 files changed, 2 insertions(+), 57 deletions(-)

diff --git a/README.md b/README.md
index 794c75c..814a750 100644
--- a/README.md
+++ b/README.md
@@ -49,6 +49,8 @@ Catmandu::MARC - Catmandu modules for working with MARC data
 - [Catmandu::Fix::marc\_map](https://metacpan.org/pod/Catmandu::Fix::marc_map)
 - [Catmandu::Fix::marc\_spec](https://metacpan.org/pod/Catmandu::Fix::marc_spec)
 - [Catmandu::Fix::marc\_add](https://metacpan.org/pod/Catmandu::Fix::marc_add)
+- [Catmandu::Fix::marc\_append](https://metacpan.org/pod/Catmandu::Fix::marc_append)
+- [Catmandu::Fix::marc\_replace\_all](https://metacpan.org/pod/Catmandu::Fix::marc_replace_all)
 - [Catmandu::Fix::marc\_remove](https://metacpan.org/pod/Catmandu::Fix::marc_remove)
 - [Catmandu::Fix::marc\_xml](https://metacpan.org/pod/Catmandu::Fix::marc_xml)
 - [Catmandu::Fix::marc\_in\_json](https://metacpan.org/pod/Catmandu::Fix::marc_in_json)
diff --git a/lib/Catmandu/MARC.pm b/lib/Catmandu/MARC.pm
index 0306df2..91a2282 100644
--- a/lib/Catmandu/MARC.pm
+++ b/lib/Catmandu/MARC.pm
@@ -207,63 +207,6 @@ sub marc_add {
     $data;
 }
 
-sub marc_replace_all {
-    my ($self,$data,$marc_path,$regex,$value) = @_;
-    my $record = $data->{'record'};
-
-    return $data unless defined $record;
-
-    if ($value =~ /^\$\.(\S+)/) {
-        my $path = $1;
-        $value = Catmandu::Util::data_at($path,$data);
-    }
-
-    if (Catmandu::Util::is_array_ref $value) {
-        $value = $value->[-1];
-    }
-    elsif (Catmandu::Util::is_hash_ref $value) {
-        my $last;
-        for (keys %$value) {
-            $last = $value->{$_};
-        }
-        $value = $last;
-    }
-
-    my $context = $self->compile_marc_path($marc_path, subfield_wildcard => 1);
-
-    confess "invalid marc path" unless $context;
-
-    for my $field (@$record) {
-        my ($tag, $ind1, $ind2, @subfields) = @$field;
-
-        if ($context->{is_regex_field}) {
-            next unless $tag =~ $context->{field_regex};
-        }
-        else {
-            next unless $tag eq $context->{field};
-        }
-
-        if (defined $context->{ind1}) {
-            if (!defined $ind1 || $ind1 ne $context->{ind1}) {
-                next;
-            }
-        }
-        if (defined $context->{ind2}) {
-            if (!defined $ind2 || $ind2 ne $context->{ind2}) {
-                next;
-            }
-        }
-
-        for (my $i = 0; $i < @subfields; $i += 2) {
-            if ($subfields[$i] =~ $context->{subfield}) {
-                $field->[$i + 4] =~ s{$regex}{$value}g;
-            }
-        }
-    }
-
-    $data;
-}
-
 sub marc_append {
     my ($self,$data,$marc_path,$value) = @_;
     my $record = $data->{'record'};

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