1 package Config::Any::General;
\r
8 Config::Any::General - Load Config::General files
\r
12 Loads Config::General files. Example:
\r
15 <Component Controller::Foo>
\r
24 =head2 extensions( )
\r
26 return an array of valid extensions (C<cnf>, C<conf>).
\r
31 return qw( cnf conf );
\r
34 =head2 load( $file )
\r
36 Attempts to load C<$file> via Config::General.
\r
44 # work around bug (?) in Config::General
\r
45 # return if $class->_test_perl($file);
\r
47 require Config::General;
\r
48 my $configfile = Config::General->new( $file );
\r
49 my $config = { $configfile->getall };
\r
54 # this is a bit of a hack but necessary, because Config::General is *far* too lax
\r
55 # about what it will load -- specifically, it seems to be quite happy to load a Perl
\r
56 # config file (ie, a file which is valid Perl and creates a hashref) as if it were
\r
57 # an Apache-style configuration file, presumably due to laziness on the part of the
\r
61 my ($class, $file) = @_;
\r
63 eval { $is_perl_src = do "$file"; };
\r
64 delete $INC{$file}; # so we don't screw stuff later on
\r
65 return defined $is_perl_src;
\r
72 =item * Brian Cassidy E<lt>bricas@cpan.orgE<gt>
\r
80 =item * Joel Bernstein C<< <rataxis@cpan.org> >>
\r
84 =head1 COPYRIGHT AND LICENSE
\r
86 Copyright 2006 by Brian Cassidy
\r
88 Portions Copyright 2006 Portugal Telecom
\r
90 This library is free software; you can redistribute it and/or modify
\r
91 it under the same terms as Perl itself.
\r
99 =item * L<Config::Any>
\r
101 =item * L<Config::General>
\r