Dpkg::Conf(3perl)
πΈ NAME πΈ
Dpkg::Conf β parse dpkg configuration files. This lil page is the manual page for Dpkg::Conf(3perl) from libdpkg-perl, and it's literally here to help you read options out of config files without losing your mind π.
π¦ DESCRIPTION π¦
The Dpkg::Conf object lowkey lets you read options from a configuration file. It can export an array that can then be parsed exactly like @ARGV β so yes bestie, it slots right into your normal argument pipeline, no cap β¨.
π METHODS π
Here's the full method roster, no skips π :
$conf = Dpkg::Conf->new(%opts)β create a newDpkg::Confobject. Obsessed with fresh objects tbh π.allow_shortβ if set to true (it defaults to false), then short options are allowed in the configuration file, and they should be prepended with a single hyphen.
@options = @{$conf}/@options = $conf->get_options()β returns the list of options that can be parsed like@ARGV.$count = $conf->load($file)β read options from a file. Returns the number of options parsed.$count = $conf->load_system_config($file)β read options from a system configuration file. Returns the number of options parsed.$count = $conf->load_user_config($file)β read options from a user configuration file. It will try to use the XDG directory, either$XDG_CONFIG_HOME/dpkg/or$HOME/.config/dpkg/. Returns the number of options parsed.$conf->load_config($file)β read options from system and user configuration files. Returns the number of options parsed.$count = $conf->parse($fh)β parse options from a file handle. When called multiple times, the parsed options are accumulated. Returns the number of options parsed.$conf->filter(%opts)β filter the list of configuration options. Options:removeβ a function returning a boolean, used to decide whether to remove the configuration option, executed as$opts{remove}->($option).keepβ a function returning a boolean, used to decide whether to keep the configuration option, executed as$opts{keep}->($option).
$string = "$conf"β returns a string representation of the content.$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->save($file)β save the options in a file.
π CHANGES π
The receipts, freshest first:
Version 1.04 (dpkg 1.20.0)
- Remove croak: For
'format_argv'in$conf->filter(). - Remove methods:
$conf->get(),$conf->set().
Version 1.03 (dpkg 1.18.8)
- Obsolete option:
'format_argv'in$conf->filter(). - Obsolete methods:
$conf->get(),$conf->set(). - New methods:
$conf->load_system_config(),$conf->load_system_user(),$conf->load_config().
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.
Sign-off: this is the Dpkg::Conf(3perl) page, version 1.23.11-dirty, dated 2026-09-09. Byeee bestie, go parse those options π
π«Ά
π¦ where this page comes from
- arch rolling: dpkg 1.23.11-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms