Fix/marc_remove.pm

filter: Statementstmt 100% 19 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 96.0% 24 / 25 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Importer/MARC/RAW.pm ↑ Summary Fix/marc_append.pm »
1 package Catmandu::Fix::marc_remove;
2  
3 4 ▶use Catmandu::Sane;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use Catmandu::MARC;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use Catmandu::Fix::Has;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 with 'Catmandu::Fix::Inlineable';
9  
10 4 our $VERSION = '1.33';
11  
12 4 has marc_path => (fix_arg => 1);
13  
14 11 ▶sub fix {
Subroutine fix: called CC=1 SCAR=0.0
Pod undocumented
15 11 my ($self,$data) = @_;
16 11 my $marc_path = $self->marc_path;
17 11 return Catmandu::MARC->instance->marc_remove($data, $marc_path);
18 }
19  
20 =head1 NAME
21  
22 Catmandu::Fix::marc_remove - remove marc (sub)fields
23  
24 =head1 SYNOPSIS
25  
26 # remove all marc 600 fields
27 marc_remove('600')
28  
29 # remove the 245-a subfield
30 marc_remove('245a')
31  
32 =head1 DESCRIPTION
33  
34 Remove (sub)fields in a MARC record
35  
36 =head1 METHODS
37  
38 =head2 marc_remove(MARC_PATH)
39  
40 Delete the (sub)fields from the MARC record as indicated by the MARC_PATH.
41  
42 =head1 INLINE
43  
44 This Fix can be used inline in a Perl script:
45  
46 use Catmandu::Fix::marc_remove as => 'marc_remove';
47  
48 my $data = { record => [...] };
49  
50 $data = marc_remove($data,'600');
51  
52 =head1 SEE ALSO
53  
54 L<Catmandu::Fix::marc_add>,
55 L<Catmandu::Fix::marc_copy>,
56 L<Catmandu::Fix::marc_cut>,
57 L<Catmandu::Fix::marc_paste>,
58 L<Catmandu::Fix::marc_set>
59  
60 =cut
61  
62 4 1;
« Importer/MARC/RAW.pm ↑ Summary Fix/marc_append.pm »