table of contents
Tirex::Config(3pm) | User Contributed Perl Documentation | Tirex::Config(3pm) |
NAME¶
Tirex::Config - Configuration
SYNOPSIS¶
my $config_dir = $opts{'config'} || $Tirex::TIREX_CONFIGDIR; my $config_file = $config_dir . '/' . $Tirex::TIREX_CONFIGFILENAME; Tirex::Config::init($config_file); Tirex::Config::dump_to_syslog(); my $some_var = Tirex::Config::get('some_option', $Tirex::SOME_OPTION);
DESCRIPTION¶
Methods for reading the main Tirex configuration file (usually /etc/tirex/tirex.conf) and accessing the config options.
METHODS¶
init($configfilename [,$prefix])¶
Loads the given config file. Dies on failure. If $prefix is given, all keys are prepended with $prefix and a dot. Does not overwrite already loaded data.
dump_to_syslog()¶
Dump config to syslog.
get($key [,$default [, $pattern]])¶
Returns the value of config key $key, or $default if the value is unset.
If $pattern is available the value is checked against it. Will croak if it doesn't match.
get_int($key [,$default])¶
Returns the value of config key $key as integer, or $default if the value is unset.
2023-04-11 | perl v5.36.0 |