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. $desc is 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 $fh is 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 a Dpkg::Compression::FileHandle object 🧚
    • if $opts{compression} is false, the decompression support gets disabled.
    • if $filename is "-", then the standard input is read β€” and ngl, no compression is allowed in that case ⚠️
  • $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 a Dpkg::Compression::FileHandle object πŸ“
    • if $opts{compression} is false, the compression support gets disabled.
    • if $filename is "-", then the standard output is used β€” and heads up, data are written uncompressed in that case πŸ’€
  • $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