Dpkg::Interface::Storable(3perl)
β¨ Dpkg::Interface::Storable β¨
okay bestie, welcome to Dpkg::Interface::Storable, straight out of libdpkg-perl β this is the parent class of the dpkg-perl universe and it's literally the group chat everyone else inherits from π«Ά
π NAME π
Dpkg::Interface::Storable β the common methods squad that handles object serialization, iykyk π
π¦ DESCRIPTION π¦
so real talk: Dpkg::Interface::Storable is only meant to be used as a parent class for other classes. that's it, that's the vibe. it does not fly solo βοΈ
what it does do is hand down a whole set of common methods, and every single one of them is built on top of just two basic methods: parse() and output(). iconic minimalism, honestly π
πΈ BASE METHODS πΈ
these are the methods that must be provided by whichever class wants to inherit from Dpkg::Interface::Storable β otherwise the provided methods literally can't do their thing. no cap, they're the main character energy this whole module runs on π
$obj->parse($fh[, $desc])β this method initializes the object with the data stored in the filehandle.$descis optional and it's a textual description of the filehandle, used in error messages. cute little label for when things go sideways π$string = $obj->output([$fh])β this method returns a string representation of the object in$string, and it also writes that same string to$fh(if$fhis defined). double duty slay β¨
π PROVIDED METHODS π
$obj->load($filename, %opts)β initialize the object with the data stored in the file. the file can be compressed, and it'll get decompressed on the fly by using aDpkg::Compression::FileHandleobject π§- if
$opts{compression}is false, the decompression support gets disabled. - if
$filenameis"-", then the standard input is read β and ngl, no compression is allowed in that case β οΈ
- if
$obj->save($filename, %opts)β store the object in the file. if the filename ends with a known compression extension, it will be compressed on the fly by using aDpkg::Compression::FileHandleobject π- if
$opts{compression}is false, the compression support gets disabled. - if
$filenameis"-", then the standard output is used β and heads up, data are written uncompressed in that case π
- if
$string = "$obj"β return a string representation of the object. stringify her, she deserves it π
π CHANGES π
β Version 1.01 (dpkg 1.19.0)
new options: the $obj->load() and $obj->save() methods support a new compression option. glow up complete π
β Version 1.00 (dpkg 1.15.6)
mark the module as public. she's out and she's thriving π
that's the whole page, bestie β go forth and inherit responsibly π«Ά
version 1.23.11-dirty Β· dated 2026-09-09 Β· and that's the Dpkg::Interface::Storable(3perl) era signing off ππ mwah, ily, see u in the man pages β¨
π¦ 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