Dpkg::Conf(3)

NAME
Dpkg::Conf - parse dpkg configuration files

DESCRIPTION
The Dpkg::Conf object can be used to read options from a configuration file. It can export an array that can then be parsed exactly like @ARGV.

METHODS

$conf = Dpkg::Conf->new(%opts)
    Create a new Dpkg::Conf object. Some options can be set through %opts: if allow_short evaluates to true (it defaults to false), then short options are allowed in the configuration file, they should be prepended with a single hyphen.

@$conf
@options = $conf->get_options()
    Returns the list of options that can be parsed like @ARGV.

$value = $conf->get($name)
    Returns the value of option $name, where the option name should not have "--" prefixed. If the option is not present the function will return undef.

$conf->set($name, $value)
    Set the $value of option $name, where the option name should not have "--" prefixed.

$conf->load($file)
    Read options from a file. Return the number of options parsed.

$conf->parse($fh)
    Parse options from a file handle. Return the number of options parsed.

$conf->filter(%opts)
    Filter the list of options, either removing or keeping all those that return true when &$opts{remove}($option) or &opts{keep}($option) is called. If $opts{format_argv} is true the long options passed to the filter functions will have "--" prefixed.

$string = $conf->output($fh)
    Write the options in the given filehandle (if defined) and return a string representation of the content (that would be) written.

"$conf"
    Return a string representation of the content.

$conf->save($file)
    Save the options in a file.

CHANGES

  Version 1.02 (dpkg 1.18.5)
New option: Accept new option 'format_argv' in $conf->filter().

New methods: $conf->get(), $conf->set().

  Version 1.01 (dpkg 1.15.8)
New method: $conf->filter()

  Version 1.00 (dpkg 1.15.6)
Mark the module as public.

AUTHOR
Raphaël Hertzog <hertzog@debian.org>.