Tirex::Config(3pm)

Tirex::Config3pm

Configuration

Usage

 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);

Overview

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.

Releases

2 releases since Debian 12 (Bookworm); the text changed 1 time.

  1. 12
  2. 13

From tirex 0.7.1-3+b2 in Debian 13 (Trixie). Parsed by carta from the page's man source.