| 1 | package Iterator::File::Utility; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | ## $Id: Utility.pm,v 1.4 2008/06/11 05:20:07 wdr1 Exp $ | ||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||
| 5 | 7 | ▶ | use 5.006; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | 7 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 7 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 7 | our $VERSION = substr(q$Revision: 1.4 $, 10); | |||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 7 | our %default_config = | |||||||||||||||||||||||||||
| 12 | ( | ||||||||||||||||||||||||||||
| 13 | 'verbose' => 0, | ||||||||||||||||||||||||||||
| 14 | 'debug' => 0, | ||||||||||||||||||||||||||||
| 15 | ); | ||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 0 | ▶ | sub new { | ||||||||||||||||||||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 18 | 0 | my ($class, %config) = @_; | |||||||||||||||||||||||||||
| 19 | |||||||||||||||||||||||||||||
| 20 | 0 | %config = (%config, %default_config); | |||||||||||||||||||||||||||
| 21 | 0 | ▶ | if ($ENV{'ITERATOR_FILE_DEBUG'}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 22 | 0 | $config{'debug'} = $ENV{'ITERATOR_FILE_DEBUG'}; | |||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 0 | my $self = bless(\%config, $class); | |||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 0 | return $self; | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 0 | ▶ | sub _verbose { | ||||||||||||||||||||||||||
|
Subroutine
_verbose: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 33 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 0 | ▶ | return unless ($self->{verbose} || $self->{debug}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->{"verbose"} or $self->{"debug"}
MC/DC0%0/2
$self->{"verbose"} or $self->{"debug"}
$self->{"verbose"}
$self->{"debug"}
Truth table0%0/3
A or B
A= $self->{"verbose"}B= $self->{"debug"}
| |||||||||||||||||||||||||||||
| 36 | 0 | print @_, "\n"; | |||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||
| 40 | 0 | ▶ | sub _debug { | ||||||||||||||||||||||||||
|
Subroutine
_debug: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||
| 41 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | 0 | ▶ | return unless ($self->{debug}); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 44 | 0 | print @_, "\n"; | |||||||||||||||||||||||||||
| 45 | } | ||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | 7 | 1; | |||||||||||||||||||||||||||
| 49 | __END__ | ||||||||||||||||||||||||||||