Moose/Reader/File/Iso2709.pm

filter: Statementstmt 100% 27 / 27 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 97.2% 35 / 36 CC 2 SCAR 2.5
CC
2
Cov
100%
read
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Moose/Reader/String/Iso2709.pm ↑ Summary Moose/Formater.pm »
1 package MARC::Moose::Reader::File::Iso2709;
2 # ABSTRACT: File reader for MARC::Moose record from ISO2709 file
3 2 $MARC::Moose::Reader::File::Iso2709::VERSION = '1.0.49';
4 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use Modern::Perl;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use MARC::Moose::Record;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use MARC::Moose::Parser::Iso2709;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 with 'MARC::Moose::Reader::File';
10  
11  
12 has '+parser' => (
13 1 ▶ default => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
14 1 my $parser = MARC::Moose::Parser::Iso2709->new();
15 1 return $parser;
16 }
17 2 );
18  
19  
20 3 ▶sub read {
Subroutine read: called CC=2 SCAR=6.9
Pod undocumented
21 3 my $self = shift;
22  
23 3 $self->count( $self->count + 1);
24  
25 3 my $fh = $self->{fh};
26  
27 3 ▶ return if eof($fh);
Branch: 1 branch
BranchTrueFalseTotal
if eof $fh 1 2 3
28  
29 2 local $/ = "\x1D"; # End of record
30 2 my $raw = <$fh>;
31  
32 # remove illegal garbage that sometimes occurs between records
33 2 $raw =~ s/^[ \x00\x0a\x0d\x1a]+//;
34  
35 2 $self->parser->parse( $raw );
36 }
37  
38  
39 2 __PACKAGE__->meta->make_immutable;
40  
41 2 1;
42  
43 __END__
« Moose/Reader/String/Iso2709.pm ↑ Summary Moose/Formater.pm »