File Coverage

blib/lib/Catmandu/Fix/marc_decode_dollar_subfields.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 0 1 0.0
total 19 20 95.0


line stmt bran cond sub pod time code
1             package Catmandu::Fix::marc_decode_dollar_subfields;
2              
3 1     1   700 use Catmandu::Sane;
  1         2  
  1         7  
4 1     1   569 use Catmandu::MARC;
  1         4  
  1         28  
5 1     1   6 use Moo;
  1         2  
  1         4  
6 1     1   659 use Catmandu::Fix::Has;
  1         959  
  1         6  
7              
8             with 'Catmandu::Fix::Inlineable';
9              
10             our $VERSION = '1.19';
11              
12             sub fix {
13 1     1 0 2665 my ($self,$data) = @_;
14 1         7 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;