Dpkg::Control::Info(3perl) libdpkg-perl Dpkg::Control::Info(3perl)
Dpkg::Control::Info - parse files like debian/control
| Use Case | Command | Description |
|---|---|---|
| 📂 Create and load default control file | $c = Dpkg::Control::Info->new() |
Loads debian/control by default, or from a filename or STDIN. |
| 🔍 Access source package info | $c->get_source() |
Returns a Dpkg::Control object with source fields. |
| 📦 Access binary package by index | $c->get_pkg_by_idx($idx) |
Returns binary package info at position $idx (1‑based). |
| 🏷️ Access binary package by name | $c->get_pkg_by_name($name) |
Returns binary package info for the named package. |
| 📜 Output control information | $c->output([$fh]) |
Return content as string; optionally print to filehandle. |
It provides a class to access data of files that follow the same syntax as debian/control.
$c = Dpkg::Control::Info->new(%opts) — Create a new Dpkg::Control::Info object. Loads the file from the filename option; if no option is specified, filename defaults to debian/control. If a scalar is passed instead, it will be used as the filename. If filename is "-", it parses the standard input. If filename is undef, no loading will be performed.$c->reset() — Resets what got read.$c->parse($fh, $description) — Parse a control file from the given filehandle. Exits in case of errors. $description is used to describe the filehandle (ideally a filename or description) and is used in error messages. The data in the object is reset before parsing new control files.$c->load($file) — Load the content of $file. Exits in case of errors. If $file is "-", it loads from the standard input.$c->[0] / $c->get_source() — Returns a Dpkg::Control object containing the fields concerning the source package.$c->get_pkg_by_idx($idx) — Returns a Dpkg::Control object containing the fields concerning the binary package numbered $idx (starting at 1).$c->get_pkg_by_name($name) — Returns a Dpkg::Control object containing the fields concerning the binary package named $name.$c->get_packages() — Returns a list containing the Dpkg::Control objects for all binary packages.$str = $c->output([$fh]) — Return the content info into a string. If $fh is specified, print it into the filehandle."$c" — Return a string representation of the content.@{$c} — Return a list of Dpkg::Control objects; the first one corresponds to source information and the following ones are the binary packages information.New argument: The $c->new() constructor accepts an %opts argument.
Mark the module as public.
Generated by phpman v4.9.26-5-g7740029 Author: Che Dong Under GNU General Public License
2026-08-25 14:11 @216.73.217.127
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)