- CONSTRUCT RULES
Pickles::Config - Config Object
use MyApp::Config; my $config = MyApp::Config->construct; my $component = $config->get( $component_name ); my $path = $config->path_to( $subpath, ... );
create new config object.
- files => \@files
specify the config files. if relative paths are specified, convert to absolute path from application home.
- home => $home
specify the application home directory.
returns a config object which is based on predefined rules and ENV values. see CONSTRUCT RULES section.
returns a application home dir's Path::Class::Dir object.
get config value.
construct absolute path from application home.
following files and env values are used in construct.
This file is always read, and will be read first. Use it to populate sane defaults for your app
This file is read after etc/config.pl, and is read only for backwards compatibility. THIS FEATURE WILL BE REMOVED IN THE FUTURE.
If you set the environment variable MYAPP_ENV, Pickles will go and read a config file named using that term. For example, if you set MYAPP_ENV to be
'test', then it Pickles will attemp to read
NOTE: The name 'MYAPP_ENV' should be changed according to your app name. For example, If you built a Pickles app named Foo::Bar, then the environment variable that you want to set is FOO_BAR_ENV, not MYAPP_ENV
NOTE: The filename that this environment affects also dependson the value of MYAPP_CONFIG. See below.
If you set the environment variable MYAPP_CONFIG, Pickles will go and read that file. Use this to specify an alternate config file.
NOTE: The name 'MYAPP_CONFIG' should be changed according to your app name. For example, If you built a Pickles app named Foo::Bar, then the environment variable that you want to set is FOO_BAR_CONFIG, not MYAPP_CONFIG
This value is subsequently use in the MYAPP_ENV. For example, if you set MYAPP_CONFIG to be
'foo.pl', then setting MYAPP_ENV to
'test'will trigger Pickles to read foo_test.pl, not config_test.pl