POE::Filter::Zlib(3)
π 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 thecompressanduncompresszlib 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 π
POEPOE::FilterPOE::Filter::Zlib::StreamCompress::ZlibPOE::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 π«Ά
π COPYRIGHT AND LICENSE π
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
- fedora 43: perl-POE-Filter-Zlib 2.04-26.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms