POE::Filter::Zlib(3)

πŸ“¦
version 2.04 Β· 2 versions
, in fedora 43

πŸ’– POE::Filter::Zlib πŸ’–

okay bestie, so this is POE::Filter::Zlib(3) β€” a page from the User Contributed Perl Documentation, and it's literally a POE filter wrapped around Compress::Zlib. squeeze text down, puff it back up, the whole vibe. πŸŽ€


✨ VERSION ✨

version 2.04 β€” yes she's on 2.04, keep up πŸ’…


🌸 SYNOPSIS 🌸

here's the whole thing, copy-paste ready, no cap:

use POE::Filter::Zlib;

my $filter = POE::Filter::Zlib->new();
my $scalar = 'Blah Blah Blah';
my $compressed_array   = $filter->put( [ $scalar ] );
my $uncompressed_array = $filter->get( $compressed_array );

use POE qw(Filter::Stackable Filter::Line Filter::Zlib);

my ($filter) = POE::Filter::Stackable->new();
$filter->push( POE::Filter::Zlib->new(),
               POE::Filter::Line->new( InputRegexp => '\015?\012', OutputLiteral => "\015\012" ),

(yes, the second block ends on a comma with no closing paren, that's just how the original is written, we don't touch the sacred text πŸ™ˆ)


πŸ¦‹ DESCRIPTION πŸ¦‹

so POE::Filter::Zlib hands you a POE filter that does compression and uncompression using Compress::Zlib. it is suitable for use with POE::Filter::Stackable, bestie. stack her up.

⚠️ but listen β€” this filter is not ideal for streaming compressed data over sockets etc., because it employs the compress and uncompress zlib functions. it's giving whole-buffer energy, not drip-feed energy.

if streaming is your moment, POE::Filter::Zlib::Stream is recommended for that type of activity. periodt. πŸ”₯


πŸŽ€ CONSTRUCTOR πŸŽ€

new

creates a new POE::Filter::Zlib object, slay. it takes one optional argument:

'level': the level of compression to employ.

consult Compress::Zlib for details, iykyk. πŸ’œ


✨ METHODS ✨

get

get_one_start

get_one

takes an arrayref which contains lines of compressed input. returns an arrayref of uncompressed lines. glow up complete ✨

get_pending

returns any data in a filter's input buffer. the filter's input buffer is not cleared, however. lowkey important, don't forget it. πŸ™ˆ

put

takes an arrayref containing lines of uncompressed output, returns an arrayref of compressed lines. it's giving compression πŸ’…

clone

makes a copy of the filter, and clears the copy's buffer. fresh start, main character energy. πŸ¦‹

level

sets the level of compression employed to the given value. if no value is supplied, it returns the current level setting. icon behavior. πŸ‘‘


🌈 SEE ALSO 🌈

  • POE
  • POE::Filter
  • POE::Filter::Zlib::Stream
  • Compress::Zlib
  • POE::Filter::Stackable

go read them, bestie, they're all part of the lore πŸ“š


πŸ’– AUTHORS πŸ’–

  • Chris Williams <chris@bingosnet.co.uk>
  • Martijn van Beers

absolute legends, we stan 🫢


this software is copyright (c) 2017 by Chris Williams and Martijn van Beers.

this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. free as in freedom, bestie πŸŽ€


and that's the whole page!! mwah πŸ’‹ this was POE::Filter::Zlib(3) from perl v5.42.0, dated 2025-07-25 β€” go compress something cute, ily, bye!! πŸ“πŸ§šπŸ’œ

πŸ“¦ where this page comes from