Add built local::lib
[catagits/Gitalist.git] / local-lib5 / lib / perl5 / Config / Any / Perl.pm
CommitLineData
3fea05b9 1package Config::Any::Perl;
2
3use strict;
4use warnings;
5
6use base 'Config::Any::Base';
7
8my %cache;
9
10=head1 NAME
11
12Config::Any::Perl - Load Perl config files
13
14=head1 DESCRIPTION
15
16Loads Perl files. Example:
17
18 {
19 name => 'TestApp',
20 'Controller::Foo' => {
21 foo => 'bar'
22 },
23 'Model::Baz' => {
24 qux => 'xyzzy'
25 }
26 }
27
28=head1 METHODS
29
30=head2 extensions( )
31
32return an array of valid extensions (C<pl>, C<perl>).
33
34=cut
35
36sub extensions {
37 return qw( pl perl );
38}
39
40=head2 load( $file )
41
42Attempts to load C<$file> as a Perl file.
43
44=cut
45
46sub load {
47 my $class = shift;
48 my $file = shift;
49 my $content;
50
51 unless ( $content = $cache{ $file } ) {
52 $content = require $file;
53 $cache{ $file } = $content;
54 }
55
56 return $content;
57}
58
59=head1 AUTHOR
60
61Brian Cassidy E<lt>bricas@cpan.orgE<gt>
62
63=head1 COPYRIGHT AND LICENSE
64
65Copyright 2006-2009 by Brian Cassidy
66
67This library is free software; you can redistribute it and/or modify
68it under the same terms as Perl itself.
69
70=head1 SEE ALSO
71
72=over 4
73
74=item * L<Catalyst>
75
76=item * L<Config::Any>
77
78=back
79
80=cut
81
821;