Moose/Reader/File/Isis.pm untested

filter: Statementstmt 0.0% 0 / 28 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 38 CC 3 SCAR 18.4
CC
3
Cov
0%
read
12.0
BEGIN
2.0
BEGIN
2.0
CRAP 6.3
1 package MARC::Moose::Reader::File::Isis;
2 # ABSTRACT: A file reader for ISIS (DOS) encoded records
3 $MARC::Moose::Reader::File::Isis::VERSION = '1.0.49';
4 use Moose;
5  
6 use Carp;
7 use MARC::Moose::Record;
8 use MARC::Moose::Parser::Isis;
9  
10 with 'MARC::Moose::Reader::File';
11  
12  
13  
14 has '+parser' => ( default => sub { MARC::Moose::Parser::Isis->new() } );
15  
16  
17 sub read {
18 my $self = shift;
19  
20 $self->count( $self->count + 1 );
21  
22 my $fh = $self->fh;
23 my $raw;
24 while ( <$fh> ) {
25 s/\x0a|\x0d//g;
26 $raw .= $_;
27 last if /\x1d/; # End of record separator
28 }
29 return 0 unless $raw;
30  
31 return $self->parser->parse( $raw );
32 }
33  
34 __PACKAGE__->meta->make_immutable;
35  
36 1;
37  
38 __END__