line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::marc_remove; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
14532
|
use Catmandu::Sane; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
26
|
|
4
|
3
|
|
|
3
|
|
656
|
use Catmandu::MARC; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
68
|
|
5
|
3
|
|
|
3
|
|
24
|
use Moo; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
23
|
|
6
|
3
|
|
|
3
|
|
1305
|
use Catmandu::Fix::Has; |
|
3
|
|
|
|
|
775
|
|
|
3
|
|
|
|
|
25
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
with 'Catmandu::Fix::Inlineable'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '1.19'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has marc_path => (fix_arg => 1); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub fix { |
15
|
6
|
|
|
6
|
0
|
15859
|
my ($self,$data) = @_; |
16
|
6
|
|
|
|
|
28
|
my $marc_path = $self->marc_path; |
17
|
6
|
|
|
|
|
42
|
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
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 DESCRIPTION |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
Remove (sub)fields in a MARC record |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 METHODS |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head2 marc_remove(MARC_PATH) |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Delete the (sub)fields from the MARC record as indicated by the MARC_PATH. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 INLINE |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
This Fix can be used inline in a Perl script: |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
use Catmandu::Fix::marc_remove as => 'marc_remove'; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
my $data = { record => [...] }; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
$data = marc_remove($data,'600'); |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 SEE ALSO |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
L<Catmandu::Fix::marc_add>, |
56
|
|
|
|
|
|
|
L<Catmandu::Fix::marc_copy>, |
57
|
|
|
|
|
|
|
L<Catmandu::Fix::marc_cut>, |
58
|
|
|
|
|
|
|
L<Catmandu::Fix::marc_paste>, |
59
|
|
|
|
|
|
|
L<Catmandu::Fix::marc_set> |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=cut |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
1; |