Fix/marc_decode_dollar_subfields.pm

filter: Statementstmt 100% 17 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 95.6% 22 / 23 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Fix/marc_sort.pm ↑ Summary Importer/MARC/RAW.pm »
1 package Catmandu::Fix::marc_decode_dollar_subfields;
2  
3 1 ▶use Catmandu::Sane;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Catmandu::MARC;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Catmandu::Fix::Has;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 with 'Catmandu::Fix::Inlineable';
9  
10 1 our $VERSION = '1.33';
11  
12 1 ▶sub fix {
Subroutine fix: called CC=1 SCAR=0.0
Pod undocumented
13 1 my ($self,$data) = @_;
14 1 return Catmandu::MARC->instance->marc_decode_dollar_subfields($data);
15 }
16  
17 =head1 NAME
18  
19 Catmandu::Fix::marc_decode_dollar_subfields - decode double encoded dollar subfields
20  
21 =head1 SYNOPSIS
22  
23 marc_decode_dollar_subfields()
24  
25 =head1 DESCRIPTION
26  
27 In some environments MARC subfields can contain data values that can be interpreted
28 as subfields itself. E.g. when the 245-$a subfield contains the data:
29  
30 My Title $h subsubfield
31  
32 then the $h = subsubfield will not be accessible with normal MARC processing tools.
33 Use the 'marc_decode_dollar_subfields()' fix to re-evaluate all the MARC subfields
34 for these hidden data.
35  
36 =head1 METHODS
37  
38 =head2 marc_decode_dollar_subfields()
39  
40 Decode double encoded dollar subfields into real MARC subfields.
41  
42 =head1 INLINE
43  
44 This Fix can be used inline in a Perl script:
45  
46 use Catmandu::Fix::marc_decode_dollar_subfields as => 'marc_decode_dollar_subfields';
47  
48 my $data = { record => [...] };
49  
50 $data = marc_decode_dollar_subfields($data);
51  
52 =head1 SEE ALSO
53  
54 L<Catmandu::Fix>
55  
56 =cut
57  
58 1 1;
« Fix/marc_sort.pm ↑ Summary Importer/MARC/RAW.pm »