| 1 | package Finance::IIF; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use 5.006; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 1 | ▶ | use Carp qw(carp croak); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use IO::File (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 1 | our $VERSION = '0.21_02'; | |||||||||||||||||||||||||||
| 10 | 1 | $VERSION = eval $VERSION; | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | 16 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=6 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 13 | 16 | my $class = shift; | |||||||||||||||||||||||||||
| 14 | 16 | my %opt = @_; | |||||||||||||||||||||||||||
| 15 | 16 | my $self = {}; | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 16 | ▶ | $self->{debug} = $opt{debug} || 0; | ||||||||||||||||||||||||||
|
Condition100%2/2
$opt{'debug'} || 0
MC/DC100%1/1
$opt{'debug'} || 0
$opt{'debug'}
Truth table100%2/2
A
A= $opt{'debug'}
| |||||||||||||||||||||||||||||
| 18 | 16 | ▶ | $self->{autodetect} = $opt{autodetect} || 0; | ||||||||||||||||||||||||||
|
Condition100%2/2
$opt{'autodetect'} || 0
MC/DC100%1/1
$opt{'autodetect'} || 0
$opt{'autodetect'}
Truth table100%2/2
A
A= $opt{'autodetect'}
| |||||||||||||||||||||||||||||
| 19 | 16 | ▶ | $self->{field_separator} = $opt{field_separator} || "\t"; | ||||||||||||||||||||||||||
|
Condition100%2/2
$opt{'field_separator'} || "\t"
MC/DC100%1/1
$opt{'field_separator'} || "\t"
$opt{'field_separator'}
Truth table100%2/2
A
A= $opt{'field_separator'}
| |||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | 16 | bless( $self, $class ); | |||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 16 | ▶ | if ( $opt{record_separator} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 24 | 1 | $self->record_separator( $opt{record_separator} ); | |||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | 16 | ▶ | if ( $opt{file} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 28 | 6 | $self->file( $opt{file} ); | |||||||||||||||||||||||||||
| 29 | 6 | $self->open; | |||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||
| 31 | 16 | return $self; | |||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 28 | ▶ | sub file { | ||||||||||||||||||||||||||
|
Subroutine
file: called CC=5 SCAR=16.1
Pod
documented
| |||||||||||||||||||||||||||||
| 35 | 28 | my $self = shift; | |||||||||||||||||||||||||||
| 36 | 28 | ▶ | if (@_) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 37 | 10 | ▶ | my @file = ( ref( $_[0] ) eq "ARRAY" ? @{ shift @_ } : (), @_ ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 38 | 10 | $self->{file} = [@file]; | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | 28 | ▶ | if ( $self->{file} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 41 | 26 | ▶ | return wantarray ? @{ $self->{file} } : $self->{file}->[0]; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||
| 43 | else { | ||||||||||||||||||||||||||||
| 44 | 2 | return undef; | |||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | 11 | ▶ | sub record_separator { | ||||||||||||||||||||||||||
|
Subroutine
record_separator: called CC=4 SCAR=14.1
Pod
documented
| |||||||||||||||||||||||||||||
| 49 | 11 | my $self = shift; | |||||||||||||||||||||||||||
| 50 | 11 | ▶ | if (@_) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 51 | 4 | ▶ | $self->{record_separator} = $_[0] if ( $_[0] ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||
| 53 | 11 | ▶ | return $self->{record_separator} || $/; | ||||||||||||||||||||||||||
|
Condition66%2/3
$self->{'record_separator'} || $/
MC/DC0%0/2
$self->{'record_separator'} || $/
$self->{'record_separator'}
$/
Truth table66%2/3
A || B
A= $self->{'record_separator'}B= $/
| |||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||
| 56 | 26 | ▶ | sub _filehandle { | ||||||||||||||||||||||||||
|
Subroutine
_filehandle: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||
| 57 | 26 | my $self = shift; | |||||||||||||||||||||||||||
| 58 | 26 | ▶ | if (@_) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 59 | 7 | my @args = @_; | |||||||||||||||||||||||||||
| 60 | 7 | ▶ | $self->{_filehandle} = IO::File->new(@args) | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 61 | or croak("Failed to open file '$args[0]': $!"); | ||||||||||||||||||||||||||||
| 62 | 7 | $self->{_linecount} = 0; | |||||||||||||||||||||||||||
| 63 | 7 | $self->{_filehandle}->binmode(); | |||||||||||||||||||||||||||
| 64 | } | ||||||||||||||||||||||||||||
| 65 | 26 | ▶ | if ( !$self->{_filehandle} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 66 | 5 | croak("No filehandle available"); | |||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||
| 68 | 21 | return $self->{_filehandle}; | |||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | 8 | ▶ | sub open { | ||||||||||||||||||||||||||
|
Subroutine
open: called CC=8 SCAR=20.8
Pod
documented
| |||||||||||||||||||||||||||||
| 72 | 8 | my $self = shift; | |||||||||||||||||||||||||||
| 73 | 8 | ▶ | if (@_) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 74 | 1 | $self->file(@_); | |||||||||||||||||||||||||||
| 75 | } | ||||||||||||||||||||||||||||
| 76 | 8 | ▶ | if ( $self->file ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 77 | 7 | $self->_filehandle( $self->file ); | |||||||||||||||||||||||||||
| 78 | 7 | ▶ | if ( $self->{autodetect} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 79 | 4 | ▶ | if ( $self->_filehandle->seek( -2, 2 ) ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 80 | 3 | my $buffer = ""; | |||||||||||||||||||||||||||
| 81 | 3 | $self->_filehandle->read( $buffer, 2 ); | |||||||||||||||||||||||||||
| 82 | 3 | ▶ | if ( $buffer eq "\015\012" ) { | ||||||||||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||||||||||
| 83 | 1 | $self->record_separator("\015\012"); | |||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||
| 85 | elsif ( $buffer =~ /\012$/ ) { | ||||||||||||||||||||||||||||
| 86 | 1 | $self->record_separator("\012"); | |||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||
| 88 | elsif ( $buffer =~ /\015$/ ) { | ||||||||||||||||||||||||||||
| 89 | 1 | $self->record_separator("\015"); | |||||||||||||||||||||||||||
| 90 | } | ||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||
| 93 | 7 | $self->reset(); | |||||||||||||||||||||||||||
| 94 | } | ||||||||||||||||||||||||||||
| 95 | else { | ||||||||||||||||||||||||||||
| 96 | 1 | croak("No file specified"); | |||||||||||||||||||||||||||
| 97 | } | ||||||||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||
| 100 | 1 | ▶ | sub next { | ||||||||||||||||||||||||||
|
Subroutine
next: called CC=15 SCAR=52.0
Pod
documented
| |||||||||||||||||||||||||||||
| 101 | 1 | my $self = shift; | |||||||||||||||||||||||||||
| 102 | 1 | my %object; | |||||||||||||||||||||||||||
| 103 | 1 | my $continue = 1; | |||||||||||||||||||||||||||
| 104 | 1 | ▶ | if ( $self->_filehandle->eof ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 105 | 0 | return undef; | |||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||
| 107 | 0 | my $line; | |||||||||||||||||||||||||||
| 108 | 0 | ▶ | while ( !$self->_filehandle->eof && $continue ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not $self->_filehandle->eof and $continue
MC/DC0%0/2
not $self->_filehandle->eof and $continue
not $self->_filehandle->eof
$continue
Truth table0%0/3
not(A) and B
A= not $self->_filehandle->eofB= $continue
| |||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||
| 110 | # IIF files sometimes contain embedded record_separators so if | ||||||||||||||||||||||||||||
| 111 | # the previous line didn't have enough fields keep adding to it | ||||||||||||||||||||||||||||
| 112 | 0 | ▶ | if ( $self->{_need_more} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 113 | 0 | ▶ | if ( $self->{_need_more} > 8 ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 114 | 0 | $self->_warning("Giving up trying to get next record"); | |||||||||||||||||||||||||||
| 115 | 0 | delete $self->{_need_more}; | |||||||||||||||||||||||||||
| 116 | 0 | $continue = 0; | |||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||
| 118 | else { | ||||||||||||||||||||||||||||
| 119 | 0 | $line .= $self->record_separator . $self->_getline; | |||||||||||||||||||||||||||
| 120 | } | ||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||
| 122 | else { | ||||||||||||||||||||||||||||
| 123 | 0 | $line = $self->_getline; | |||||||||||||||||||||||||||
| 124 | 0 | ▶ | next if ( $line =~ /^\s*$/ ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 125 | } | ||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||
| 127 | 0 | my @data = $self->_parseline($line); | |||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||
| 129 | 0 | ▶ | if ( $self->{debug} > 1 ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 130 | 0 | warn("_getline: line($line)\n"); | |||||||||||||||||||||||||||
| 131 | 0 | warn( "_parseline: data[" . scalar(@data) . "](@data)\n" ); | |||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||
| 134 | 0 | ▶ | if ( $data[0] =~ /^!(.*)$/ ) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 135 | 0 | delete( $self->{headerfields} ); | |||||||||||||||||||||||||||
| 136 | 0 | shift(@data); | |||||||||||||||||||||||||||
| 137 | 0 | $self->{header} = $1; | |||||||||||||||||||||||||||
| 138 | 0 | $self->{headerfields} = \@data; | |||||||||||||||||||||||||||
| 139 | } | ||||||||||||||||||||||||||||
| 140 | elsif ( $data[0] eq $self->{header} ) { | ||||||||||||||||||||||||||||
| 141 | 0 | $object{header} = shift(@data); | |||||||||||||||||||||||||||
| 142 | 0 | my $num_hdr = scalar( @{ $self->{headerfields} } ); | |||||||||||||||||||||||||||
| 143 | 0 | my $num_dat = scalar(@data); | |||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||
| 145 | # have seen IIF timer data where last column (USEID) was | ||||||||||||||||||||||||||||
| 146 | # missing but QuickBooks imports the data without error | ||||||||||||||||||||||||||||
| 147 | 0 | ▶ | if ( $num_dat < ( $num_hdr - 1 ) ) { | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 148 | 0 | $self->{_need_more}++; | |||||||||||||||||||||||||||
| 149 | } | ||||||||||||||||||||||||||||
| 150 | elsif ( $num_dat > $num_hdr ) { | ||||||||||||||||||||||||||||
| 151 | 0 | $self->{_need_more} = $continue = 0; | |||||||||||||||||||||||||||
| 152 | 1 | ▶ | no warnings 'uninitialized'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 153 | 0 | $self->_warning( "parse error: found $num_dat fields but" | |||||||||||||||||||||||||||
| 154 | . " expected $num_hdr." ); | ||||||||||||||||||||||||||||
| 155 | warn( | ||||||||||||||||||||||||||||
| 156 | "error info: [header,data] " | ||||||||||||||||||||||||||||
| 157 | . join( | ||||||||||||||||||||||||||||
| 158 | ' ', | ||||||||||||||||||||||||||||
| 159 | map( "$_" . '[' | ||||||||||||||||||||||||||||
| 160 | 0 | . $self->{headerfields}->[$_] . ',' | |||||||||||||||||||||||||||
| 161 | . $data[$_] . ']', | ||||||||||||||||||||||||||||
| 162 | 0 .. ( $num_hdr - 1 ) ) | ||||||||||||||||||||||||||||
| 163 | ) | ||||||||||||||||||||||||||||
| 164 | ); | ||||||||||||||||||||||||||||
| 165 | } | ||||||||||||||||||||||||||||
| 166 | else { | ||||||||||||||||||||||||||||
| 167 | 0 | $self->{_need_more} = $continue = 0; | |||||||||||||||||||||||||||
| 168 | 0 | ▶ | for ( my $i = 0 ; $i <= $#{ $self->{headerfields} } ; $i++ ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 169 | 0 | ▶ | my $val = defined( $data[$i] ) ? $data[$i] : ""; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 170 | 0 | $object{ $self->{headerfields}[$i] } = $val; | |||||||||||||||||||||||||||
| 171 | } | ||||||||||||||||||||||||||||
| 172 | } | ||||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||||
| 174 | else { | ||||||||||||||||||||||||||||
| 175 | 0 | $self->_warning("unable to parse line '$_'"); | |||||||||||||||||||||||||||
| 176 | } | ||||||||||||||||||||||||||||
| 177 | } | ||||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||
| 179 | 0 | ▶ | if ($continue) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 180 | 0 | return undef; | |||||||||||||||||||||||||||
| 181 | } | ||||||||||||||||||||||||||||
| 182 | else { | ||||||||||||||||||||||||||||
| 183 | 0 | return \%object; | |||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||
| 185 | } | ||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||
| 187 | 0 | ▶ | sub _parseline { | ||||||||||||||||||||||||||
|
Subroutine
_parseline: not called CC=14 SCAR=53.5
| |||||||||||||||||||||||||||||
| 188 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 189 | 0 | my $line = shift; | |||||||||||||||||||||||||||
| 190 | 0 | ▶ | my $sep = $self->{field_separator} || "\t"; | ||||||||||||||||||||||||||
|
Condition0%0/2
$self->{'field_separator'} || "\t"
MC/DC0%0/1
$self->{'field_separator'} || "\t"
$self->{'field_separator'}
Truth table0%0/2
A
A= $self->{'field_separator'}
| |||||||||||||||||||||||||||||
| 191 | 0 | my @data; | |||||||||||||||||||||||||||
| 192 | 0 | ▶ | while ( defined $line ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 193 | 0 | ▶ | if ( $line =~ /^"(.*?)(?:[^\\]["])[$sep](.*)/s ) { | ||||||||||||||||||||||||||
|
Branch: 5 branches
| |||||||||||||||||||||||||||||
| 194 | 0 | ▶ | warn("parse1: data($1) line($2)\n") if ( $self->{debug} > 2 ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 195 | 0 | $line = $2; | |||||||||||||||||||||||||||
| 196 | 0 | push( @data, $1 ); | |||||||||||||||||||||||||||
| 197 | } | ||||||||||||||||||||||||||||
| 198 | elsif ( $line =~ /^([^$sep]+)[$sep](.*)/s ) { | ||||||||||||||||||||||||||||
| 199 | 0 | ▶ | warn("parse2: data($1) line($2)\n") if ( $self->{debug} > 2 ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 200 | 0 | $line = $2; | |||||||||||||||||||||||||||
| 201 | 0 | push( @data, $1 ); | |||||||||||||||||||||||||||
| 202 | } | ||||||||||||||||||||||||||||
| 203 | elsif ( $line =~ /^[$sep](.*)/s ) { | ||||||||||||||||||||||||||||
| 204 | 0 | ▶ | warn("parse3: data() line($1)\n") if ( $self->{debug} > 2 ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 205 | 0 | $line = $1; | |||||||||||||||||||||||||||
| 206 | 0 | push( @data, "" ); | |||||||||||||||||||||||||||
| 207 | } | ||||||||||||||||||||||||||||
| 208 | elsif ( $line =~ /^"(.*?)(?:[^\\]["])$/s ) { | ||||||||||||||||||||||||||||
| 209 | 0 | ▶ | warn("parse4: data($1) line()\n") if ( $self->{debug} > 2 ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 210 | 0 | $line = undef; | |||||||||||||||||||||||||||
| 211 | 0 | push( @data, $1 ); | |||||||||||||||||||||||||||
| 212 | } | ||||||||||||||||||||||||||||
| 213 | elsif ( $line =~ /^(.+)$/s ) { | ||||||||||||||||||||||||||||
| 214 | 0 | ▶ | warn("parse5: data($1) line()\n") if ( $self->{debug} > 2 ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 215 | 0 | $line = undef; | |||||||||||||||||||||||||||
| 216 | 0 | push( @data, $1 ); | |||||||||||||||||||||||||||
| 217 | } | ||||||||||||||||||||||||||||
| 218 | else { | ||||||||||||||||||||||||||||
| 219 | 0 | ▶ | warn("parse6: data() line($line)\n") if ( $self->{debug} > 2 ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 220 | 0 | $line = undef; | |||||||||||||||||||||||||||
| 221 | 0 | push( @data, "" ); | |||||||||||||||||||||||||||
| 222 | } | ||||||||||||||||||||||||||||
| 223 | } | ||||||||||||||||||||||||||||
| 224 | 0 | return @data; | |||||||||||||||||||||||||||
| 225 | } | ||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||
| 227 | 1 | ▶ | sub _getline { | ||||||||||||||||||||||||||
|
Subroutine
_getline: called CC=1 SCAR=1.2
| |||||||||||||||||||||||||||||
| 228 | 1 | my $self = shift; | |||||||||||||||||||||||||||
| 229 | 1 | local $/ = $self->record_separator; | |||||||||||||||||||||||||||
| 230 | 1 | my $line = $self->_filehandle->getline; | |||||||||||||||||||||||||||
| 231 | 0 | $self->{_linecount}++; | |||||||||||||||||||||||||||
| 232 | 0 | chomp($line); | |||||||||||||||||||||||||||
| 233 | 0 | return $line; | |||||||||||||||||||||||||||
| 234 | } | ||||||||||||||||||||||||||||
| 235 | |||||||||||||||||||||||||||||
| 236 | 0 | ▶ | sub _warning { | ||||||||||||||||||||||||||
|
Subroutine
_warning: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 237 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 238 | 0 | my $message = shift; | |||||||||||||||||||||||||||
| 239 | carp( $message | ||||||||||||||||||||||||||||
| 240 | . " in file '" | ||||||||||||||||||||||||||||
| 241 | . $self->file | ||||||||||||||||||||||||||||
| 242 | . "' line " | ||||||||||||||||||||||||||||
| 243 | 0 | . $self->{_linecount} ); | |||||||||||||||||||||||||||
| 244 | } | ||||||||||||||||||||||||||||
| 245 | |||||||||||||||||||||||||||||
| 246 | 8 | ▶ | sub reset { | ||||||||||||||||||||||||||
|
Subroutine
reset: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 247 | 8 | my $self = shift; | |||||||||||||||||||||||||||
| 248 | 8 | $self->_filehandle->seek( 0, 0 ); | |||||||||||||||||||||||||||
| 249 | } | ||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||
| 251 | 1 | ▶ | sub close { | ||||||||||||||||||||||||||
|
Subroutine
close: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 252 | 1 | my $self = shift; | |||||||||||||||||||||||||||
| 253 | 1 | $self->_filehandle->close; | |||||||||||||||||||||||||||
| 254 | } | ||||||||||||||||||||||||||||
| 255 | |||||||||||||||||||||||||||||
| 256 | 1 | 1; | |||||||||||||||||||||||||||
| 257 | |||||||||||||||||||||||||||||
| 258 | __END__ | ||||||||||||||||||||||||||||