| 1 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | # Config::General::Hierarchical.pm - Hierarchical Generic Config Module | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | # Purpose: Permits to organize configuration values | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | # in a hierarchical structure of files | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | # | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | # Copyright (c) 2007-2009 Daniele Ricci <icc |AT| cpan.org>. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | # All Rights Reserved. Std. disclaimer applies. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | # Artificial License, same as perl itself. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | package Config::General::Hierarchical; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 5 | $Config::General::Hierarchical::VERSION = 0.07; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 5 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 5 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 5 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 5 | ▶ | use Clone::PP qw( clone ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 5 | ▶ | use Config::General; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 5 | ▶ | use Config::General::Hierarchical::ExcludeWeaken; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 5 | ▶ | use Cwd qw( abs_path ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 5 | ▶ | use Scalar::Util qw( weaken ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 5 | ▶ | use base 'Class::Accessor::Fast'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 5 | my @properties = qw( constraint name opt value ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 5 | my %properties = map( ( $_ => 1 ), @properties ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 5 | __PACKAGE__->mk_accessors( @properties, qw( cache ) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 5 | my %Config_General_Proxy = ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | '-AutoLaunder' => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | '-CComments' => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | '-LowerCaseNames' => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | '-SplitDelimiter' => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | '-SplitPolicy' => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 90 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=12 SCAR=24.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 90 | my ( $ref, %args ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 90 | my $file; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | my %general; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 90 | my %props; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 90 | my %options; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 90 | foreach my $key ( keys %args ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 234 | ▶ | if ( $key eq 'file' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 42 | $file = $args{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | elsif ( $properties{$key} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | 168 | $props{$key} = $args{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | elsif ( $Config::General::Hierarchical::Options::options{$key} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 19 | $options{$key} = $args{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | elsif ( $Config_General_Proxy{$key} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 2 | $general{$key} = $args{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 90 | ▶ | my $class = ref $ref || $ref or croak __PACKAGE__ . ": wrong new call"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
ref $ref || $ref
MC/DC100%2/2
ref $ref || $ref
ref $ref
$ref
Truth table100%3/3
A || B
A= ref $refB= $ref
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 89 | my $self = $class->SUPER::new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | cache => {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | %props | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 89 | ▶ | unless (%props) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 45 | $self->opt( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | Config::General::Hierarchical::Options->new( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | files => [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | general => \%general, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | inherits => 'inherits', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | root => $self, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | struct => { '0' => {} }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | undefined => 'undefined', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | wild => '*', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | %options | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | weaken( $self->opt->{root} ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 45 | ▶ | unless $Config::General::Hierarchical::ExcludeWeaken::exclude; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 45 | ▶ | $self->read($file) if $file; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 36 | ▶ | $self->check if $args{check}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 79 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 3 | ▶ | sub check { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
check: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | 3 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 3 | foreach my $key ( keys %{ $self->value } ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 7 | my $v = $self->get($key); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | 6 | ▶ | $v->check if eval { $v->isa(__PACKAGE__); }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 2 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 12 | ▶ | sub import { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
import: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | 12 | my ( $class, @pars ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 12 | my $syntax = $class->syntax; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 12 | ▶ | die "$class: syntax method musts return an HASH reference\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | if ref $syntax ne 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | 11 | $class->check_syntax( $syntax, [] ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | 47 | ▶ | sub check_syntax { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
check_syntax: called CC=10 SCAR=23.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 47 | my ( $class, $syntax, $parents ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 47 | foreach my $key ( keys %$syntax ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 129 | my $ref = ref $syntax->{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | 129 | my $syn = $syntax->{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | 129 | push @$parents, $key; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 129 | ▶ | if ($ref) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 37 | ▶ | die "$class: wrong use of $ref reference as syntax for variable '" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | . join( '->', @$parents ) . "'\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | if $ref ne 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 36 | $class->check_syntax( $syn, $parents ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 92 | ▶ | die "$class: wrong '$syn' syntax for variable '" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $syn and not $syn =~ /^[amuABDEINST]*$/
MC/DC100%2/2
defined $syn and not $syn =~ /^[amuABDEINST]*$/
defined $syn
not $syn =~ /^[amuABDEINST]*$/
Truth table100%3/3
A and not(B)
A= defined $synB= not $syn =~ /^[amuABDEINST]*$/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | . join( '->', @$parents ) . "'\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | if defined $syn && $syn !~ /^[amuABDEINST]*$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 91 | ▶ | die | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%9/9
defined $syn and $syn =~ /m/ and syntax_check_get_type($syn) ne "S" and not $syn =~ /a/
defined $syn and $syn =~ /m/ and syntax_check_get_type($syn) ne "S"
defined $syn and $syn =~ /m/
MC/DC100%4/4
defined $syn and $syn =~ /m/ and syntax_check_get_type($syn) ne "S" and not $syn =~ /a/
defined $syn
$syn =~ /m/
syntax_check_get_type($syn) ne "S"
not $syn =~ /a/
Truth table100%5/5
A and B and C and not(D)
A= defined $synB= $syn =~ /m/C= syntax_check_get_type($syn) ne "S"D= not $syn =~ /a/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | "$class: wrong use of 'm' flag for not string nor array variable '" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | . join( '->', @$parents ) . "'\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | if defined $syn | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | && $syn =~ /m/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | && syntax_check_get_type($syn) ne 'S' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | && $syn !~ /a/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 125 | pop @$parents; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 255 | ▶ | sub get { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
get: called CC=12 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 255 | my ( $self, $name, @names ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | 255 | ▶ | my $vname = $self->name ? $self->name . '->' . $name : $name; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 255 | ▶ | if ( exists $self->cache->{$name} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | 53 | my $value = $self->cache->{$name}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 53 | ▶ | return $value unless scalar @names; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 10 | ▶ | return $value->get(@names) if eval { $value->isa(__PACKAGE__) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 4 | croak __PACKAGE__ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | . ": can't get subkey '$names[0]' value for not node variable '$vname'"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | my $syntax = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | exists $self->constraint->{$name} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | ? $self->constraint->{$name} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | 202 | ▶ | : $self->constraint->{ $self->wild }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | 202 | ▶ | my $value = $self->value->{$name} || $self->value->{ $self->wild }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%3/3
$self->value->{$name} || $self->value->{$self->wild}
MC/DC100%2/2
$self->value->{$name} || $self->value->{$self->wild}
$self->value->{$name}
$self->value->{$self->wild}
Truth table100%3/3
A || B
A= $self->value->{$name}B= $self->value->{$self->wild}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 202 | ▶ | if ( !defined $value || ref $value->value ne 'HASH' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
not defined $value or ref $value->value ne "HASH"
MC/DC100%2/2
not defined $value or ref $value->value ne "HASH"
not defined $value
ref $value->value ne "HASH"
Truth table100%3/3
not(A) or B
A= not defined $valueB= ref $value->value ne "HASH"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | 161 | ▶ | croak __PACKAGE__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | . ": can't get subkey '$names[0]' value for not node variable '$vname'" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | if scalar @names; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | 160 | return $self->cache->{$name} = | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | $self->syntax_check( $vname, $value, $syntax ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 41 | ▶ | $self->cache->{$name} = $value = $self->syntax_check( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$syntax || {}
MC/DC100%1/1
$syntax || {}
$syntax
Truth table100%2/2
A
A= $syntax
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | $vname, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | $self->new( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | constraint => $syntax || {}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | name => $vname, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | opt => $self->opt, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | value => $value->value | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | $syntax | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 37 | ▶ | return $value unless scalar @names; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | 6 | return $value->get(@names); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | 5 | our $AUTOLOAD; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | 741 | ▶ | sub AUTOLOAD { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
AUTOLOAD: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 741 | my ( $self, @args ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | 741 | my $name = $AUTOLOAD; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | 741 | $name =~ s/\w+:://g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | 741 | ▶ | return $self->get( $1, @args ) if $name =~ /^_(\w+)$/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | return $self->opt->$name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | 609 | ▶ | if $Config::General::Hierarchical::Options::options{$name}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | 1 | my $ref = ref $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | 1 | croak "Can't locate object method \"$name\" via package \"$ref\""; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | # simply avoid AUTOLOAD is called when an object is destroied | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | 0 | ▶ | sub DESTROY { } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
DESTROY: not called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | 2 | ▶ | sub getk { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
getk: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 2 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 2 | ▶ | croak __PACKAGE__ . ": can't get keys before reading any file" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | unless $self->value; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 1 | return keys %{ $self->value }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | 42 | ▶ | sub read { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
read: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | 42 | my ( $self, $name ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 42 | $self->constraint( $self->syntax ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 42 | $self->value( $self->read_( $name, [] ) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 33 | $self->expand_wild_keys( $self->value ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | 33 | $self->name(''); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 33 | return $self; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | 65 | ▶ | sub read_ { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
read_: called CC=14 SCAR=26.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | 65 | my ( $self, $name, $children ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | 65 | my $tmp = eval { abs_path($name); }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | 65 | ▶ | my $error = $@ || !$tmp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$@ || !$tmp
MC/DC50%1/2
$@ || !$tmp
$@
!$tmp
Truth table66%2/3
A || not(B)
A= $@B= !$tmp
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | 65 | ▶ | $name = $tmp if $tmp; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | 65 | my $files = $self->opt->files; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 65 | my $in_file = | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | $name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | . join( '', reverse( map( "\ninherited by: $files->[$_]", @$children ) ) ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | . "\n "; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | 65 | my $nfile = scalar @$files; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | 65 | ▶ | croak __PACKAGE__ . ": no such directory: $in_file" if $error; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | 64 | ▶ | croak __PACKAGE__ . ": no such file: $in_file" unless -e $name; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | 63 | ▶ | croak __PACKAGE__ . ": recursive hierarchy\nin file: $in_file" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | if grep /^$name$/, map $files->[$_], @$children; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 62 | push @$files, $name; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | 62 | my $cfg; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | 62 | eval { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | $cfg = Config::General->new( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | '-AllowMultiOptions' => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | '-AutoTrue' => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | '-CComments' => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | '-ConfigFile' => $name, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | '-ExtendedAccess' => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | '-InterPolateEnv' => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | '-InterPolateVars' => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | '-MergeDuplicateBlocks' => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | '-MergeDuplicateOptions' => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | '-SlashIsDirectory' => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | '-UseApacheInclude' => 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | 62 | ( %{ $self->opt->general } ) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | 62 | ▶ | if ($@) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | 3 | my @list = split /\n/, $@; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | 3 | pop @list; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | 3 | my $msg = join "\n", @list; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | 3 | croak __PACKAGE__ . ": $msg\nin file: $in_file"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 284 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 285 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 286 | 59 | ▶ | if ( scalar @$children ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 287 | 21 | my $str = $self->opt->struct; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 288 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 289 | 21 | foreach (@$children) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 290 | 23 | $str = $str->{$_}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 291 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 292 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 293 | 21 | $str->{$nfile} = {}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 294 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 295 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 296 | 59 | my $hash = { $cfg->getall }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 297 | 59 | my $syntax = $self->inherits; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 298 | 59 | my $inherits = $hash->{$syntax}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 299 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 300 | 59 | delete $hash->{$syntax}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 301 | 59 | my ( $undefined, $value ) = $self->convert_hash( $hash, $nfile, $in_file ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 302 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 303 | 57 | ▶ | if ($inherits) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 304 | 19 | my $parents; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 305 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 306 | 19 | ▶ | if ( !ref $inherits ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 307 | 13 | $parents = [$inherits]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 308 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 309 | elsif ( ref $inherits eq 'ARRAY' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 310 | 5 | $parents = $inherits; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 311 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 312 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 313 | 1 | croak __PACKAGE__ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 314 | . ": wrong use of inherits ('$syntax') directive\nin file: $in_file"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 315 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 316 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 317 | 18 | push @$children, @$files - 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 318 | 18 | foreach my $parent ( reverse @$parents ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 319 | 23 | ▶ | if ( $parent =~ /^\// ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 320 | 1 | $name = $parent; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 321 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 322 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 323 | 22 | my @list = split /\//, $name; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 324 | 22 | pop @list; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 325 | 22 | $name = join( '/', @list ) . '/' . $parent; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 326 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 327 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 328 | 23 | $hash = $self->read_( $name, $children ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 329 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 330 | 20 | $self->merge_values( $value, $hash, $self->constraint ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 331 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 332 | 15 | pop @$children; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 333 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 334 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 335 | 53 | $self->undefine( $value, $undefined, $nfile ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 336 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 337 | 53 | return $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 338 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 339 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 340 | 129 | ▶ | sub convert_hash { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
convert_hash: called CC=9 SCAR=22.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 341 | 129 | my ( $self, $hash, $file, $in_file ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 342 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 343 | 129 | my $syntax = $self->inherits; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 344 | 129 | my %undefined; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 345 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 346 | croak __PACKAGE__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 347 | . ": inherits ('$syntax') directive cannot be used as node name\nin file: $in_file" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 348 | 129 | ▶ | if exists $hash->{$syntax}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 349 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 350 | 128 | $syntax = $self->undefined; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 351 | 128 | my $undefined = $hash->{$syntax}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 352 | 128 | delete $hash->{$syntax}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 353 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 354 | 128 | foreach my $key ( keys %$hash ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 355 | 262 | ▶ | if ( ref $hash->{$key} eq 'HASH' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 356 | ( $undefined{$key}, my $tmp ) = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 357 | 70 | $self->convert_hash( $hash->{$key}, $file, $in_file ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 358 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 359 | 261 | ▶ | $hash->{$key} = '' unless defined $hash->{$key}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 360 | $hash->{$key} = Config::General::Hierarchical::Value->new( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 361 | 261 | { value => $hash->{$key}, file => $file } ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 362 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 363 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 364 | 127 | ▶ | if ($undefined) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 365 | 13 | ▶ | if ( !ref $undefined ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 366 | 6 | $undefined{$undefined} = undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 367 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 368 | elsif ( ref $undefined eq 'ARRAY' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 369 | 6 | $undefined{$_} = undef foreach @$undefined; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 370 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 371 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 372 | 1 | croak __PACKAGE__ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 373 | . ": wrong use of undefined ('$syntax') directive\nin file: $in_file"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 374 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 375 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 376 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 377 | 126 | return ( \%undefined, $hash ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 378 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 379 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 380 | 74 | ▶ | sub merge_values { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
merge_values: called CC=19 SCAR=29.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 381 | 74 | my ( $self, $value, $hash, $constraint ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 382 | 74 | my ( $key, $val ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 383 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 384 | 74 | foreach $key ( keys %$value ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 385 | 360 | $val = $value->{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 386 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 387 | 360 | ▶ | if ( ref $val eq 'Config::General::Hierarchical::Value' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 388 | 132 | ▶ | my $other = exists $hash->{$key} ? $hash->{$key}->value : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 389 | my $syn = ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 390 | exists $constraint->{$key} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 391 | ? $constraint->{$key} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 392 | 132 | ▶ | : $constraint->{ $self->wild } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
(exists $constraint->{$key} ? $constraint->{$key} : $$constraint{$self->wild}) || {}
MC/DC100%1/1
(exists $constraint->{$key} ? $constraint->{$key} : $$constraint{$self->wild}) || {}
(exists $constraint->{$key} ? $constraint->{$key} : $$constraint{$self->wild})
Truth table100%2/2
A
A= (exists $constraint->{$key} ? $constraint->{$key} : $$constraint{$self->wild})
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 393 | ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 394 | || {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 395 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 396 | 132 | ▶ | if ( ref $val->value eq 'HASH' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 397 | 48 | ▶ | if ( ref $other eq 'HASH' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 398 | 20 | $self->merge_values( $val->value, $other, $syn ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 399 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 400 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 401 | ▶ | elsif ( !ref $syn && $syn =~ /m/ && defined $other ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%6/6
not ref $syn and $syn =~ /m/ and defined $other
not ref $syn and $syn =~ /m/
MC/DC100%3/3
not ref $syn and $syn =~ /m/ and defined $other
not ref $syn
$syn =~ /m/
defined $other
Truth table100%4/4
not(A) and B and C
A= not ref $synB= $syn =~ /m/C= defined $other
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 402 | 13 | ▶ | if ( $syn =~ /a/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 403 | 3 | ▶ | $other = [$other] unless ref $other; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 404 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 405 | 3 | ▶ | if ( ref $val->value ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 406 | 1 | unshift @{ $val->value }, @$other; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 407 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 408 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 409 | 2 | $val->value( [ @$other, $val->value ] ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 410 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 411 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 412 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 413 | 10 | $val->value( $other . $val->value ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 414 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 415 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 416 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 417 | elsif ( ref $val eq 'HASH' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 418 | 80 | ▶ | if ( exists $hash->{$key} && ref $hash->{$key} eq 'HASH' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
exists $hash->{$key} and ref $hash->{$key} eq "HASH"
MC/DC100%2/2
exists $hash->{$key} and ref $hash->{$key} eq "HASH"
exists $hash->{$key}
ref $hash->{$key} eq "HASH"
Truth table100%3/3
A and B
A= exists $hash->{$key}B= ref $hash->{$key} eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 419 | 8 | $self->merge_values( $val, $hash->{$key} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 420 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 421 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 422 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 423 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 424 | 74 | foreach $key ( keys %$hash ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 425 | 269 | ▶ | $value->{$key} = $hash->{$key} unless exists $value->{$key}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 426 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 427 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 428 | 74 | return $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 429 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 430 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 431 | 80 | ▶ | sub expand_wild_keys { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
expand_wild_keys: called CC=11 SCAR=24.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 432 | 80 | my ( $self, $value ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 433 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 434 | 80 | my $wild = $self->wild; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 435 | 80 | my $wv = $value->{$wild}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 436 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 437 | 80 | ▶ | if ( $wv && ref $wv->value eq 'HASH' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$wv and ref $wv->value eq "HASH"
MC/DC100%2/2
$wv and ref $wv->value eq "HASH"
$wv
ref $wv->value eq "HASH"
Truth table100%3/3
A and B
A= $wvB= ref $wv->value eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 438 | 2 | $wv = $wv->value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 439 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 440 | 2 | foreach my $key ( keys %$value ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 441 | 5 | my $v = $value->{$key}->value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 442 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 443 | 5 | ▶ | next if $key eq $wild; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 444 | 3 | ▶ | next if ref $v ne 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 445 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 446 | 2 | foreach my $wk ( keys %$wv ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 447 | 4 | ▶ | $v->{$wk} = clone( $wv->{$wk} ) unless exists $v->{$wk}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 448 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 449 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 450 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 451 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 452 | 80 | foreach my $key ( keys %$value ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 453 | 216 | my $v = $value->{$key}->value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 454 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 455 | 216 | ▶ | next if $key eq $wild; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 456 | 213 | ▶ | next if ref $v ne 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 457 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 458 | 47 | $self->expand_wild_keys($v); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 459 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 460 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 461 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 462 | 122 | ▶ | sub undefine { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
undefine: called CC=4 SCAR=13.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 463 | 122 | my ( $self, $value, $undefined, $file ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 464 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 465 | 122 | foreach my $key ( keys %$value ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 466 | 316 | ▶ | next unless exists $undefined->{$key}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 467 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 468 | 87 | ▶ | if ( defined $undefined->{$key} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 469 | 69 | $self->undefine( $value->{$key}->value, $undefined->{$key}, $file ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 470 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 471 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 472 | 18 | $value->{$key} = Config::General::Hierarchical::Value->new( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 473 | { value => undef, file => $file } ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 474 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 475 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 476 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 477 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 478 | 53 | ▶ | sub syntax { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
syntax: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 479 | 53 | return {}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 480 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 481 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 482 | 5 | my %types = ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 483 | A => { d => 'datetime', e => '^\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d$' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 484 | B => { d => 'boolean value', e => '^(0|1|on|off|yes|no|true|false)$' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 485 | D => { d => 'date', e => '^\d\d\d\d-\d\d-\d\d$' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 486 | E => { d => 'e-mail address', e => '^[\w\d\-_\.]+@[\w\d\-_\.]+\.\w+$' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 487 | I => { d => 'integer value', e => '^-?\d+$' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 488 | N => { d => 'number', e => '^-?\d*\.?\d+$' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 489 | S => { d => 'string' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 490 | T => { d => 'time', e => '^\d\d:\d\d:\d\d$' }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 491 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 492 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 493 | 201 | ▶ | sub syntax_check { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
syntax_check: called CC=29 SCAR=33.7
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 494 | 201 | my ( $self, $vname, $value, $syntax ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 495 | 201 | my $can_be_undefined; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 496 | 201 | my $file = 0; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 497 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 498 | 201 | ▶ | if ( defined $value | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $value and ref $value eq "Config::General::Hierarchical::Value"
MC/DC100%2/2
defined $value and ref $value eq "Config::General::Hierarchical::Value"
defined $value
ref $value eq "Config::General::Hierarchical::Value"
Truth table100%3/3
A and B
A= defined $valueB= ref $value eq "Config::General::Hierarchical::Value"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 499 | && ref $value eq 'Config::General::Hierarchical::Value' ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 500 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 501 | 148 | $file = $value->file; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 502 | 148 | $value = $value->value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 503 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 504 | 201 | $file = "\nin file: " . $self->opt->files->[$file]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 505 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 506 | 201 | ▶ | if ( defined $syntax ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 507 | $can_be_undefined = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 508 | 102 | ▶ | ref $syntax ? exists $syntax->{ $self->undefined } : $syntax =~ /u/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 509 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 510 | elsif ( defined $value ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 511 | 94 | ▶ | return ref $value ? $value : $self->convert_value( $value, $vname ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 512 | if ref $value ne 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 513 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 514 | 2 | croak __PACKAGE__ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 515 | . ": variable '$vname' is an array: should be a string or a node$file"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 516 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 517 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 518 | 107 | ▶ | unless ( defined $value ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 519 | 25 | ▶ | if ($can_be_undefined) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 520 | 12 | ▶ | return undef if ref $syntax; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 521 | 10 | ▶ | return [] if $syntax =~ /a/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 522 | 9 | ▶ | return 0 if $syntax =~ /B/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 523 | 8 | return undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 524 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 525 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 526 | 13 | croak __PACKAGE__ . ": request for undefined variable '$vname'$file"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 527 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 528 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 529 | 82 | ▶ | if ( ref $syntax ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 530 | 19 | ▶ | return $value if eval { $value->isa(__PACKAGE__) }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 531 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 532 | 2 | croak __PACKAGE__ . ": variable '$vname' should be a node$file"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 533 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 534 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 535 | 63 | my $type = syntax_check_get_type($syntax); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 536 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 537 | 63 | ▶ | if ( $syntax !~ /a/ ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 538 | 40 | ▶ | croak __PACKAGE__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 539 | . ": variable '$vname' is an array but should be a $types{$type}->{d}$file" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 540 | if ref $value eq 'ARRAY'; #"}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 541 | 38 | ▶ | croak __PACKAGE__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 542 | . ": variable '$vname' is a node but should be a $types{$type}->{d}$file" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 543 | if ref $value; #"}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 544 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 545 | 35 | $value = $self->convert_value( $value, $vname ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 546 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 547 | 35 | ▶ | return $value if $type eq 'S'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 548 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 549 | 27 | $value =~ s/^\s+//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 550 | 27 | $value =~ s/\s+$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 551 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 552 | 27 | ▶ | croak __PACKAGE__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 553 | . ": value '$value' for variable '$vname' is not a prooper $types{$type}->{d}$file" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 554 | unless $value =~ /$types{$type}->{e}/i; #}"}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 555 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 556 | 12 | ▶ | return $value if $type ne 'B'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 557 | 2 | ▶ | return $value =~ /(1|on|yes|true)/i ? 1 : 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 558 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 559 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 560 | 23 | my $ref = ref $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 561 | 23 | my @ret; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 562 | 23 | ▶ | my $arr = $ref ? $value : [$value]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 563 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 564 | 23 | ▶ | croak __PACKAGE__ . ": variable '$vname' should be an array$file" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$ref and $ref ne "ARRAY"
MC/DC100%2/2
$ref and $ref ne "ARRAY"
$ref
$ref ne "ARRAY"
Truth table100%3/3
A and B
A= $refB= $ref ne "ARRAY"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 565 | if $ref && $ref ne 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 566 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 567 | 22 | ▶ | if ( $type eq 'S' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 568 | 8 | @ret = @$arr; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 569 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 570 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 571 | 14 | foreach $value (@$arr) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 572 | 26 | $value =~ s/^\s+//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 573 | 26 | $value =~ s/\s+$//; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 574 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 575 | 26 | my @values = split /\s*,\s*/, $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 576 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 577 | 26 | foreach $value (@values) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 578 | 32 | ▶ | croak __PACKAGE__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 579 | . ": element '$value' of variable '$vname' is not a prooper $types{$type}->{d}$file" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 580 | if $value !~ /$types{$type}->{e}/i; #}"}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 581 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 582 | 31 | push @ret, $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 583 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 584 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 585 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 586 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 587 | 21 | return [ map $self->convert_value( $_, $vname ), @ret ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 588 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 589 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 590 | 72 | ▶ | sub syntax_check_get_type { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
syntax_check_get_type: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 591 | 72 | my ($syntax) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 592 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 593 | 72 | foreach (qw( A B D E I N T )) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 594 | 398 | ▶ | return $_ if $syntax =~ /$_/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 595 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 596 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 597 | 24 | return 'S'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 598 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 599 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 600 | 5 | my %back_slash = ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 601 | 36 => 36, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 602 | 92 => 92, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 603 | 97 => 7, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 604 | 98 => 8, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 605 | 102 => 12, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 606 | 110 => 10, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 607 | 114 => 13, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 608 | 116 => 9, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 609 | 118 => 11, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 610 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 611 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 612 | 152 | ▶ | sub convert_value { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
convert_value: called CC=15 SCAR=27.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 613 | 152 | my ( $self, $value, $vname ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 614 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 615 | 152 | my @arr = unpack 'C*', $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 616 | 152 | my @ret; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 617 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 618 | 152 | ▶ | while ( my $c = shift @arr ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 619 | 641 | ▶ | if ( $c == 92 && scalar @arr ) { # \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition100%2/2
$c == 92 and scalar @arr
MC/DC100%1/1
$c == 92 and scalar @arr
$c == 92
Truth table100%2/2
A
A= $c == 92
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 620 | 12 | my $n = shift @arr; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 621 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 622 | 12 | ▶ | if ( $back_slash{$n} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 623 | 11 | push @ret, $back_slash{$n}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 624 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 625 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 626 | 1 | push @ret, 92, $n; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 627 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 628 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 629 | ▶ | elsif ( $c == 36 && scalar @arr && $arr[0] == 123 ) { # $ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%5/5
$c == 36 and scalar @arr and $arr[0] == 123
$c == 36 and scalar @arr
MC/DC100%2/2
$c == 36 and scalar @arr and $arr[0] == 123
$c == 36
$arr[0] == 123
Truth table100%3/3
A and B
A= $c == 36B= $arr[0] == 123
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 630 | 13 | my $i; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 631 | my $v; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 632 | 13 | my @var_name; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 633 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 634 | 13 | ▶ | for ( $i = 1 ; $i < scalar @arr && $arr[$i] != 125 ; ++$i ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$i < scalar @arr and $arr[$i] != 125
MC/DC100%2/2
$i < scalar @arr and $arr[$i] != 125
$i < scalar @arr
$arr[$i] != 125
Truth table100%3/3
A and B
A= $i < scalar @arrB= $arr[$i] != 125
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 635 | 52 | push @var_name, $arr[$i]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 636 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 637 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 638 | 13 | ▶ | croak __PACKAGE__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 639 | . ": systax error in inline variable substitution for value '$value' for variable '$vname'" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 640 | if $i == scalar @arr; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 641 | 12 | ▶ | croak __PACKAGE__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 642 | . ": can't do inline variable substitution for variable '$vname' when reference to root node was lost" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 643 | unless $self->opt->root; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 644 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 645 | 11 | eval { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 646 | 11 | $v = $self->opt->root->get( split /->/, pack 'C*', @var_name ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 647 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 648 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 649 | 11 | ▶ | croak "$@ during inline variable sostitution for variable '$vname'" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 650 | if $@; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 651 | 7 | ▶ | croak __PACKAGE__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 652 | . ": can't use node or array variable in inline variable sostitution for variable '$vname'" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 653 | if ref $v; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 654 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 655 | 6 | ▶ | $v = '' unless defined $v; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 656 | 6 | push @ret, unpack 'C*', $v; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 657 | 6 | splice @arr, 0, $i + 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 658 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 659 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 660 | 616 | push @ret, $c; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 661 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 662 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 663 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 664 | 145 | return pack 'C*', @ret; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 665 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 666 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 667 | package Config::General::Hierarchical::Options; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 668 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 669 | 5 | ▶ | use base 'Class::Accessor::Fast'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 670 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 671 | 5 | my @options = qw( inherits root undefined wild ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 672 | 5 | our %options = map( ( $_ => 1 ), @options ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 673 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 674 | 5 | __PACKAGE__->mk_accessors( @options, qw( files general struct ) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 675 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 676 | package Config::General::Hierarchical::Value; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 677 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 678 | 5 | ▶ | use base 'Class::Accessor::Fast'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 679 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 680 | 5 | __PACKAGE__->mk_accessors(qw( file value )); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 681 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 682 | 5 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 683 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 684 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||