line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package ZCS::LocalConfig; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
21971
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
52
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
313
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.00'; |
7
|
|
|
|
|
|
|
our $DEBUG; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
{ |
10
|
|
|
|
|
|
|
my @Modules = qw(File Command); |
11
|
|
|
|
|
|
|
my %Mod_map = map { $_ => 1 } @Modules; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
0
|
|
|
0
|
0
|
|
my ( $class, %args ) = ( shift, @_ ); |
15
|
|
|
|
|
|
|
|
16
|
0
|
|
|
|
|
|
my $type = delete $args{type}; |
17
|
0
|
|
|
|
|
|
my @try = @Modules; |
18
|
|
|
|
|
|
|
|
19
|
0
|
0
|
|
|
|
|
if ($type) { |
20
|
0
|
0
|
|
|
|
|
die("invalid arg type='$type'\n") unless $Mod_map{$type}; |
21
|
0
|
|
|
|
|
|
@try = ($type); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
0
|
|
|
|
|
|
foreach my $mod (@try) { |
25
|
0
|
|
|
|
|
|
$mod = __PACKAGE__ . '::' . $mod; |
26
|
0
|
|
|
|
|
|
eval "require $mod;"; |
27
|
0
|
0
|
|
|
|
|
if ($@) { |
28
|
0
|
0
|
|
|
|
|
warn( __PACKAGE__, "::new: require '$mod' failed: $@\n" ) |
29
|
|
|
|
|
|
|
if $DEBUG; |
30
|
0
|
|
|
|
|
|
next; |
31
|
|
|
|
|
|
|
} |
32
|
0
|
|
|
|
|
|
my $obj = $mod->new(%args); |
33
|
0
|
0
|
|
|
|
|
return $obj if ($obj); |
34
|
|
|
|
|
|
|
} |
35
|
0
|
|
|
|
|
|
return undef; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |