line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Config::Merge::Perl; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
47
|
use strict; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
388
|
|
4
|
5
|
|
|
5
|
|
27
|
use warnings FATAL => 'all', NONFATAL => 'redefine'; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
930
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
Config::Merge::Perl - Load Perl config files |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 DESCRIPTION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Loads Perl files. Example: |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
{ |
15
|
|
|
|
|
|
|
name => 'TestApp', |
16
|
|
|
|
|
|
|
'Controller::Foo' => { |
17
|
|
|
|
|
|
|
foo => 'bar' |
18
|
|
|
|
|
|
|
}, |
19
|
|
|
|
|
|
|
'Model::Baz' => { |
20
|
|
|
|
|
|
|
qux => 'xyzzy' |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Any error/warning in the file will throw a fatal error. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 METHODS |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head2 extensions( ) |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
return an array of valid extensions (C, C). |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
33
|
|
|
|
|
|
|
|
34
|
5
|
|
|
5
|
1
|
22
|
sub extensions {qw( pl perl );} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head2 load( $file ) |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Attempts to load C<$file> as a Perl file. |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=cut |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub load { |
44
|
118
|
|
|
118
|
1
|
578
|
my $class = shift; |
45
|
118
|
|
|
|
|
140
|
my $file = shift; |
46
|
118
|
|
|
|
|
456
|
delete $INC{$file}; |
47
|
118
|
|
|
|
|
539
|
local ($^W) = 1; |
48
|
118
|
|
|
0
|
|
886
|
local $SIG{__WARN__} = sub { die $_[0]}; |
|
0
|
|
|
|
|
0
|
|
49
|
118
|
|
|
|
|
35320
|
require $file; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 SEE ALSO |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
L |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 THANKS |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
Thanks to Joel Bernstein and Brian Cassidy for the original Config::Any::Perl |
59
|
|
|
|
|
|
|
module |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 BUGS |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
None known |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 AUTHOR |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Clinton Gormley, Eclinton@traveljury.comE |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 COPYRIGHT |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Copyright (C) 2007 by Clinton Gormley |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 LICENSE |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or modify |
78
|
|
|
|
|
|
|
it under the same terms as Perl itself, either Perl version 5.8.7 or, |
79
|
|
|
|
|
|
|
at your option, any later version of Perl 5 you may have available. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=cut |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
1; |