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.45'; |
4
|
2
|
|
|
2
|
|
1780
|
use Moose; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
16
|
|
5
|
2
|
|
|
2
|
|
14088
|
use Modern::Perl; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
20
|
|
6
|
2
|
|
|
2
|
|
396
|
use MARC::Moose::Record; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
65
|
|
7
|
2
|
|
|
2
|
|
13
|
use MARC::Moose::Parser::Iso2709; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
640
|
|
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
|
8
|
my $self = shift; |
22
|
|
|
|
|
|
|
|
23
|
3
|
|
|
|
|
104
|
$self->count( $self->count + 1); |
24
|
|
|
|
|
|
|
|
25
|
3
|
|
|
|
|
86
|
my $fh = $self->{fh}; |
26
|
|
|
|
|
|
|
|
27
|
3
|
100
|
|
|
|
922
|
return if eof($fh); |
28
|
|
|
|
|
|
|
|
29
|
2
|
|
|
|
|
16
|
local $/ = "\x1D"; # End of record |
30
|
2
|
|
|
|
|
12
|
my $raw = <$fh>; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# remove illegal garbage that sometimes occurs between records |
33
|
2
|
|
|
|
|
8
|
$raw =~ s/^[ \x00\x0a\x0d\x1a]+//; |
34
|
|
|
|
|
|
|
|
35
|
2
|
|
|
|
|
82
|
$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.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 |