line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MARC::Moose::Reader::File::Iso2709; |
2
|
|
|
|
|
|
|
# ABSTRACT: File reader for MARC::Moose record from ISO2709 file |
3
|
|
|
|
|
|
|
$MARC::Moose::Reader::File::Iso2709::VERSION = '1.0.44'; |
4
|
2
|
|
|
2
|
|
1784
|
use Moose; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
15
|
|
5
|
2
|
|
|
2
|
|
13368
|
use Modern::Perl; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
21
|
|
6
|
2
|
|
|
2
|
|
371
|
use MARC::Moose::Record; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
46
|
|
7
|
2
|
|
|
2
|
|
11
|
use MARC::Moose::Parser::Iso2709; |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
619
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
with 'MARC::Moose::Reader::File'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
has '+parser' => ( |
13
|
|
|
|
|
|
|
default => sub { |
14
|
|
|
|
|
|
|
my $parser = MARC::Moose::Parser::Iso2709->new(); |
15
|
|
|
|
|
|
|
return $parser; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub read { |
21
|
3
|
|
|
3
|
0
|
9
|
my $self = shift; |
22
|
|
|
|
|
|
|
|
23
|
3
|
|
|
|
|
116
|
$self->count( $self->count + 1); |
24
|
|
|
|
|
|
|
|
25
|
3
|
|
|
|
|
93
|
my $fh = $self->{fh}; |
26
|
|
|
|
|
|
|
|
27
|
3
|
100
|
|
|
|
109
|
return if eof($fh); |
28
|
|
|
|
|
|
|
|
29
|
2
|
|
|
|
|
15
|
local $/ = "\x1D"; # End of record |
30
|
2
|
|
|
|
|
17
|
my $raw = <$fh>; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# remove illegal garbage that sometimes occurs between records |
33
|
2
|
|
|
|
|
10
|
$raw =~ s/^[ \x00\x0a\x0d\x1a]+//; |
34
|
|
|
|
|
|
|
|
35
|
2
|
|
|
|
|
75
|
$self->parser->parse( $raw ); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=pod |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=encoding UTF-8 |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head1 NAME |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
MARC::Moose::Reader::File::Iso2709 - File reader for MARC::Moose record from ISO2709 file |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 VERSION |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
version 1.0.44 |
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) 2021 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 |