1 package Catalyst::Plugin::ConfigLoader::Perl;
\r
8 Catalyst::Plugin::ConfigLoader::Perl - Load Perl config files
\r
12 Loads Perl files. Example:
\r
16 Controller::Config => {
\r
23 =head2 load( $file )
\r
25 Attempts to load C<$file> as a Perl file.
\r
31 my $confpath = shift;
\r
34 if( $confpath =~ /\.(.{2,4})$/ ) {
\r
35 return unless $1 =~ /^p(er)?l$/;
\r
39 @files = map { "$confpath.$_" } qw( pl perl );
\r
42 for my $file ( @files ) {
\r
43 next unless -f $file;
\r
44 return eval { require $file };
\r
52 =item * Brian Cassidy E<lt>bricas@cpan.orgE<gt>
\r
56 =head1 COPYRIGHT AND LICENSE
\r
58 Copyright 2006 by Brian Cassidy
\r
60 This library is free software; you can redistribute it and/or modify
\r
61 it under the same terms as Perl itself.
\r