| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Config::Proxy; |
|
2
|
7
|
|
|
7
|
|
3241
|
use strict; |
|
|
7
|
|
|
|
|
21
|
|
|
|
7
|
|
|
|
|
320
|
|
|
3
|
7
|
|
|
7
|
|
32
|
use warnings; |
|
|
7
|
|
|
|
|
9
|
|
|
|
7
|
|
|
|
|
287
|
|
|
4
|
7
|
|
|
7
|
|
50
|
use Carp; |
|
|
7
|
|
|
|
|
11
|
|
|
|
7
|
|
|
|
|
2604
|
|
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.0'; |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub load { |
|
9
|
9
|
|
|
9
|
0
|
24
|
my $class = shift; |
|
10
|
9
|
50
|
|
|
|
46
|
my $impl = shift or croak "proxy implementation not supplied"; |
|
11
|
9
|
|
50
|
|
|
34
|
my $method = shift // 'new'; |
|
12
|
9
|
|
|
|
|
27
|
my $modname = __PACKAGE__ . '::Impl::' . $impl; |
|
13
|
9
|
|
|
|
|
19
|
my $modpath = $modname; |
|
14
|
9
|
|
|
|
|
64
|
$modpath =~ s{::}{/}g; |
|
15
|
9
|
|
|
|
|
20
|
$modpath .= '.pm'; |
|
16
|
9
|
|
|
|
|
20
|
my $self = eval { |
|
17
|
9
|
|
|
|
|
4657
|
require $modpath; |
|
18
|
9
|
|
|
|
|
47
|
$modname->${ \$method }(@_); |
|
|
9
|
|
|
|
|
75
|
|
|
19
|
|
|
|
|
|
|
}; |
|
20
|
9
|
50
|
|
|
|
30
|
if ($@) { |
|
21
|
0
|
0
|
|
|
|
0
|
if ($@ =~ /Can't locate $modpath/) { |
|
22
|
0
|
|
|
|
|
0
|
croak "unsupported proxy implementation: $impl" |
|
23
|
|
|
|
|
|
|
} else { |
|
24
|
0
|
|
|
|
|
0
|
croak $@ |
|
25
|
|
|
|
|
|
|
} |
|
26
|
|
|
|
|
|
|
} |
|
27
|
9
|
|
|
|
|
31
|
return $self; |
|
28
|
|
|
|
|
|
|
} |
|
29
|
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub new { |
|
31
|
8
|
|
|
8
|
0
|
20
|
my $class = shift; |
|
32
|
8
|
|
|
|
|
21
|
my $impl = shift; |
|
33
|
8
|
|
|
|
|
87
|
my $self = $class->load($impl, 'new', @_); |
|
34
|
8
|
|
|
|
|
33
|
$self->reset(); |
|
35
|
8
|
|
|
|
|
44
|
$self |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |
|
39
|
|
|
|
|
|
|
__END__ |