DPKG::COMPRESSION::PROCESS(3perl)

πŸ’… Dpkg::Compression::Process(3perl) β€” the libdpkg-perl one, bestie πŸŽ€

okay so real talk, this is a Perl module page from libdpkg-perl, and it's literally about running compression and decompression processes. yes, that kind of plumbing. but it's actually kind of iconic once you get it, i promise 🫢


✨ NAME ✨

Dpkg::Compression::Process β€” the module that runs your compression/decompression processes for you, no cap πŸ’…


🌸 DESCRIPTION 🌸

So this module gives you an object oriented interface β€” like, a whole cute little object β€” to run and manage compression/decompression processes. that's it, that's the vibe. you get an object, it handles the spawnin' and the waitin', you get to live your life ✨


πŸ¦‹ METHODS πŸ¦‹

πŸŽ€ $proc = Dpkg::Compression::Process->new(%opts)

Creates a brand new instance of the object. new proc, who dis πŸ’–

Options:

  • compression β€” go peek at $proc->set_compression(), it's giving the same energy.
  • compression_level β€” and this one? see $proc->set_compression_level(), bestie.

πŸŽ€ $proc->set_compression($comp)

Picks which compression method you wanna use. lowkey important: it errors out if the method isn't supported according to compression_is_supported() (that one lives in Dpkg::Compression). so like, don't try to be cute with a fake method, it will clock you 😭


πŸŽ€ $proc->set_compression_level($level)

Same situation but for the compression level. errors out if the level isn't valid according to compression_is_valid_level() (again, from Dpkg::Compression). vibe check on your level, essentially ✨


πŸŽ€ @exec = $proc->get_compress_cmdline()

πŸŽ€ @exec = $proc->get_uncompress_cmdline()

Returns a list that's ready to be handed straight to exec(). the first element is the program name β€” either the compression one or the decompression one, depending on which method you called β€” and the elements after it are the parameters for that program.

and when it actually gets executed? the program acts as a filter between its standard input and its standard output. in goes data, out comes data, slay πŸ”₯


πŸŽ€ $proc->compress(%opts)

Starts up a compressor program. You must say where it's gonna read its uncompressed data from and where it's gonna write its compressed data to. how, you ask? by passing one "to_*" parameter and one "from_*" parameter, exactly as accepted by Dpkg::IPC::spawn() πŸ‘‘

⚠️ okay so this part matters: you must call wait_end_process() after calling this method, so the sub-process gets properly closed β€” and so you can verify that it exited without error. not optional, bestie, fr fr.

Options:

See Dpkg::IPC::spawn().


πŸŽ€ $proc->uncompress(%opts)

Basically the same deal, but for a decompressor program. This time you indicate where it'll read its compressed data from and where it'll write its uncompressed data to β€” again, one "to_*" parameter and one "from_*" parameter, as accepted by Dpkg::IPC::spawn() 🧚

⚠️ same rule, same drama: call wait_end_process() after this one too, to properly close the sub-process (and verify it exited without error). yes, both. always. πŸ’€

Options:

See Dpkg::IPC::spawn().


πŸŽ€ $proc->wait_end_process(%opts)

Calls Dpkg::IPC::wait_child() to wait until the sub-process has exited and to verify its return code. Any option you pass in gets forwarded straight to the wait_child() function β€” it's very "hand it off, i trust you" of it 🫢

Most notably you can use the "no_check" option if you'd rather verify the return code yourself instead of letting wait_child() do it for you. main character energy, honestly πŸ‘‘

Options:

See Dpkg::IPC::wait_child().


🌈 CHANGES 🌈

⭐ Version 1.00 (dpkg 1.15.6)

Marked the module as public. iconic moment, honestly, this is the glow-up ✨


and that's the page, bestie πŸ’œ written up as 1.23.11-dirty, dated 2026-09-09 β€” that's the Dpkg::Compression::Process(3perl) of the libdpkg-perl world, and now you know her πŸŽ€πŸŒΈ

πŸ“¦ where this page comes from