line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MARC::Moose::Parser::Legacy; |
2
|
|
|
|
|
|
|
# ABSTRACT: Parser for MARC::Record legacy records |
3
|
|
|
|
|
|
|
$MARC::Moose::Parser::Legacy::VERSION = '1.0.46'; |
4
|
4
|
|
|
4
|
|
33
|
use Moose; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
31
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
extends 'MARC::Moose::Parser'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
override 'parse' => sub { |
11
|
|
|
|
|
|
|
my ($self, $legacy) = @_; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
return unless $legacy; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $record = MARC::Moose::Record->new(); |
16
|
|
|
|
|
|
|
$record->_leader( $legacy->leader ); |
17
|
|
|
|
|
|
|
my @fields; |
18
|
|
|
|
|
|
|
for my $field ( $legacy->fields() ) { |
19
|
|
|
|
|
|
|
my $tag = $field->tag; |
20
|
|
|
|
|
|
|
push @fields, $tag < '010' |
21
|
|
|
|
|
|
|
? MARC::Moose::Field::Control->new( |
22
|
|
|
|
|
|
|
tag => $tag, |
23
|
|
|
|
|
|
|
value => $field->data ) |
24
|
|
|
|
|
|
|
: MARC::Moose::Field::Std->new( |
25
|
|
|
|
|
|
|
tag => $tag, |
26
|
|
|
|
|
|
|
ind1 => $field->indicator(1), |
27
|
|
|
|
|
|
|
ind2 => $field->indicator(2), |
28
|
|
|
|
|
|
|
subf => [ $field->subfields() ] ) |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
$record->fields( \@fields ); |
31
|
|
|
|
|
|
|
$record->lint($self->lint) if $self->lint; |
32
|
|
|
|
|
|
|
return $record; |
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=pod |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=encoding UTF-8 |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 NAME |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
MARC::Moose::Parser::Legacy - Parser for MARC::Record legacy records |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 VERSION |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
version 1.0.46 |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 SYNOPSYS |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
# Get a MARC::Record |
56
|
|
|
|
|
|
|
my $legacy_record = GetMarcBiblio(100); |
57
|
|
|
|
|
|
|
my $parser = MARC::Moose::Parser::Legacy->new(); |
58
|
|
|
|
|
|
|
# Transform it into MARC::Moose::Record |
59
|
|
|
|
|
|
|
my $record = $parser->parse($legacy_record); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 SEE ALSO |
62
|
|
|
|
|
|
|
=for :list |
63
|
|
|
|
|
|
|
* L<MARC::Moose> |
64
|
|
|
|
|
|
|
* L<MARC::Moose::Parser> |
65
|
|
|
|
|
|
|
* L<MARC::Record> |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 AUTHOR |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Frédéric Demians <f.demians@tamil.fr> |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
This software is copyright (c) 2022 by Frédéric Demians. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
76
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=cut |