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