Scroll to navigation

Config::ZOMG(3pm) User Contributed Perl Documentation Config::ZOMG(3pm)


Config::ZOMG - Yet Another Catalyst::Plugin::ConfigLoader-style layer over Config::Any


version 1.000000


"Config::ZOMG" is a fork of Config::JFDI. It removes a couple of unusual features and passes the same tests three times faster than Config::JFDI.

"Config::ZOMG" is an implementation of Catalyst::Plugin::ConfigLoader that exists outside of Catalyst.

"Config::ZOMG" will scan a directory for files matching a certain name. If such a file is found which also matches an extension that Config::Any can read, then the configuration from that file will be loaded.

"Config::ZOMG" will also look for special files that end with a "_local" suffix. Files with this special suffix will take precedence over any other existing configuration file, if any. The precedence takes place by merging the local configuration with the "standard" configuration via Hash::Merge::Simple.

Finally you can override/modify the path search from outside your application, by setting the "${NAME}_CONFIG" variable outside your application (where $NAME is the uppercase version of what you passed to Config::ZOMG->new).


 use Config::ZOMG;
 my $config = Config::ZOMG->new(
   name => 'my_application',
   path => 'path/to/my/application',
 my $config_hash = $config->load;

This will look for something like (depending on what Config::Any will find):




... and load the found configuration information appropiately, with "_local" taking precedence.

You can also specify a file directly:

 my $config = Config::ZOMG->new(file => '/path/to/my/application/my_application.cnf');

To later reload your configuration:




 $config = Config::ZOMG->new(...)

Returns a new "Config::ZOMG" object

You can configure the $config object by passing the following to new:

The name specifying the prefix of the configuration file to look for and the ENV variable to read. This can be a package name. In any case, :: will be substituted with _ in "name" and the result will be lowercased. To prevent modification of "name", pass it in as a scalar reference.
The directory to search in
Directly read the configuration from this file. "Config::Any" must recognize the extension. Setting this will override "path"
Disable lookup of a local configuration. The "local_suffix" option will be ignored. Off by default
The suffix to match when looking for a local configuration. "local" by default
Set this to ignore ENV. "env_lookup" will be ignored. Off by default
Additional ENV to check if $ENV{<NAME>...} is not found
A hash consisting of "Config::" driver information. This is passed directly through to "Config::Any"
A hash filled with default keys/values


 $config_hash = Config::ZOMG->open( ... )

As an alternative way to load a config "open" will pass given arguments to "new" then attempt to do "load"

Unlike "load" if no configuration files are found "open" will return "undef" (or the empty list)

This is so you can do something like:

 my $config_hash = Config::ZOMG->open( '/path/to/application.cnf' )
   or die "Couldn't find config file!"

In scalar context "open" will return the config hash, not the config object. If you want the config object call "open" in list context:

    my ($config_hash, $config) = Config::ZOMG->open( ... )

You can pass any arguments to "open" that you would to "new"



Load a config as specified by "new" and "ENV" and return a hash

This will only load the configuration once, so it's safe to call multiple times without incurring any loading-time penalty



Returns a list of files found

If the list is empty then no files were loaded/read



Returns a list of files that configuration will be loaded from. Use this method to check whether configuration files have changed, without actually reloading.



Return a clone of the configuration hash using Clone

This will load the configuration first, if it hasn't already



Reload the configuration, examining ENV and scanning the path anew

Returns a hash of the configuration









  • Arthur Axel "fREW" Schmidt <>
  • Robert Krimen <>


This software is copyright (c) 2013 by Arthur Axel "fREW" Schmidt.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

2024-03-04 perl v5.38.2