6c20cedeb0efa7effe7c34b38c6146704fd62820
[p5sagit/Config-Any.git] / lib / Config / Any / Perl.pm
1 package Config::Any::Perl;
2
3 use strict;
4 use warnings;
5
6 =head1 NAME
7
8 Config::Any::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 =head1 METHODS
25
26 =head2 extensions( )
27
28 return an array of valid extensions (C<pl>, C<perl>).
29
30 =cut
31
32 sub extensions {
33     return qw( pl perl );
34 }
35
36 =head2 load( $file )
37
38 Attempts to load C<$file> as a Perl file.
39
40 =cut
41
42 sub load {
43     my $class = shift;
44     my $file  = shift;
45     return eval { require $file };
46 }
47
48 =head1 AUTHOR
49
50 =over 4 
51
52 =item * Brian Cassidy E<lt>bricas@cpan.orgE<gt>
53
54 =back
55
56 =head1 COPYRIGHT AND LICENSE
57
58 Copyright 2006 by Brian Cassidy
59
60 This library is free software; you can redistribute it and/or modify
61 it under the same terms as Perl itself. 
62
63 =head1 SEE ALSO
64
65 =over 4 
66
67 =item * L<Catalyst>
68
69 =item * L<Config::Any>
70
71 =back
72
73 =cut
74
75 1;