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.46'; |
4
|
2
|
|
|
2
|
|
1793
|
use Moose; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
15
|
|
5
|
2
|
|
|
2
|
|
13899
|
use Modern::Perl; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
23
|
|
6
|
2
|
|
|
2
|
|
352
|
use MARC::Moose::Record; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
63
|
|
7
|
2
|
|
|
2
|
|
13
|
use MARC::Moose::Parser::Iso2709; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
557
|
|
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
|
22
|
my $self = shift; |
22
|
|
|
|
|
|
|
|
23
|
3
|
|
|
|
|
103
|
$self->count( $self->count + 1); |
24
|
|
|
|
|
|
|
|
25
|
3
|
|
|
|
|
104
|
my $fh = $self->{fh}; |
26
|
|
|
|
|
|
|
|
27
|
3
|
100
|
|
|
|
714
|
return if eof($fh); |
28
|
|
|
|
|
|
|
|
29
|
2
|
|
|
|
|
21
|
local $/ = "\x1D"; # End of record |
30
|
2
|
|
|
|
|
17
|
my $raw = <$fh>; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# remove illegal garbage that sometimes occurs between records |
33
|
2
|
|
|
|
|
14
|
$raw =~ s/^[ \x00\x0a\x0d\x1a]+//; |
34
|
|
|
|
|
|
|
|
35
|
2
|
|
|
|
|
111
|
$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.46 |
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 |