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