line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MARC::Moose::Formater::Legacy; |
2
|
|
|
|
|
|
|
# ABSTRACT: Record formater into the legacy MARC::Record object |
3
|
|
|
|
|
|
|
$MARC::Moose::Formater::Legacy::VERSION = '1.0.45'; |
4
|
4
|
|
|
4
|
|
31
|
use Moose; |
|
4
|
|
|
|
|
12
|
|
|
4
|
|
|
|
|
29
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
extends 'MARC::Moose::Formater'; |
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
27052
|
use MARC::Moose::Field::Control; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
115
|
|
9
|
4
|
|
|
4
|
|
23
|
use MARC::Moose::Field::Std; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
143
|
|
10
|
4
|
|
|
4
|
|
2401
|
use MARC::Record; |
|
4
|
|
|
|
|
32032
|
|
|
4
|
|
|
|
|
992
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
override 'format' => sub { |
14
|
|
|
|
|
|
|
my ($self, $record) = @_; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my $marc = MARC::Record->new; |
17
|
|
|
|
|
|
|
$marc->leader( $record->leader ); |
18
|
|
|
|
|
|
|
for my $field ( @{$record->fields} ) { |
19
|
|
|
|
|
|
|
my $nfield; |
20
|
|
|
|
|
|
|
if ( $field->tag < 10 ) { |
21
|
|
|
|
|
|
|
my $value = $field->value; |
22
|
|
|
|
|
|
|
$nfield = MARC::Field->new( $field->tag, $field->value ); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
else { |
25
|
|
|
|
|
|
|
my @sf; |
26
|
|
|
|
|
|
|
for (@{$field->subf}) { |
27
|
|
|
|
|
|
|
my ($letter, $value) = @$_; |
28
|
|
|
|
|
|
|
push @sf, $letter, $value if defined $value; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
$nfield = MARC::Field->new( |
31
|
|
|
|
|
|
|
$field->tag, |
32
|
|
|
|
|
|
|
(defined $field->ind1 ) ? $field->ind1 : ' ', |
33
|
|
|
|
|
|
|
(defined $field->ind2 ) ? $field->ind2 : ' ', @sf ) if @sf; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
$marc->append_fields($nfield) if $nfield; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
return $marc; |
38
|
|
|
|
|
|
|
}; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=pod |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=encoding UTF-8 |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 NAME |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
MARC::Moose::Formater::Legacy - Record formater into the legacy MARC::Record object |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 VERSION |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
version 1.0.45 |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 AUTHOR |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Frédéric Demians <f.demians@tamil.fr> |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
This software is copyright (c) 2022 by Frédéric Demians. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
66
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=cut |