/usr/share/perl5/Catmandu/Fix/Inline/marc_remove.pm is in libcatmandu-marc-perl 0.214-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | package Catmandu::Fix::Inline::marc_remove;
use Clone qw(clone);
use Carp;
require Exporter;
@ISA = qw(Exporter);
@EXPORT_OK = qw(marc_remove);
%EXPORT_TAGS = (all => [qw(marc_remove)]);
sub marc_remove {
my ($data,$marc_path) = @_;
my $ret = defined $data ? clone($data) : { record => [] };
$ret->{'record'} = [] unless $ret->{'record'};
croak "invalid marc path" unless $marc_path =~ /^\w{3}$/;
my @fields = ();
for my $field (@{$ret->{record}}) {
unless ($field->[0] eq $marc_path) {
push @fields , $field;
}
}
$ret->{record} = \@fields;
return $ret;
}
=head1 NAME
Catmandu::Fix::Inline::marc_remove - remove marc fields
=head1 SYNOPSIS
use Catmandu::Fix::Inline::marc_remove qw(:all);
my $data = marc_remove($data,'CAT');
=head1 SEE ALSO
L<Catmandu::Fix::Inline::marc_set> ,
L<Catmandu::Fix::Inline::marc_add> ,
L<Catmandu::Fix::Inline::marc_map>
=cut
1;
|