There's no efficient way to compress text streams in pure Perl. Best bet would be to use Compress::Zlib (which is lots better than calling gzip). It wouldn't be too surprising if your installation included it.

my $compressedData = Compress::Zlib::memGzip($uncompressedData); my $uncompressedData2 = Compress::Zlib::memGunzip($compressedData);

I don't understand what the problem with "installing modules" is; if you can write to a directory to install your program, you can install the (pieces of the) module to the same directory (in subdirectories) and push the appropriate paths onto @INC. I'm sure there's descriptions elsewhere on PM as to how to do that. Note that Compress::Zlib has got several pieces that will need to be installed:

/usr/lib/perl5/site_perl/5.6.1/i686-linux/auto/Compress/Zlib
/usr/lib/perl5/site_perl/5.6.1/i686-linux/auto/Compress/Zlib/Zlib.bs
/usr/lib/perl5/site_perl/5.6.1/i686-linux/auto/Compress/Zlib/Zlib.so
/usr/lib/perl5/site_perl/5.6.1/i686-linux/auto/Compress/Zlib/autosplit.ix
/usr/lib/perl5/site_perl/5.6.1/i686-linux/auto/Compress/Zlib/.packlist
/usr/lib/perl5/site_perl/5.6.1/i686-linux/Compress/Zlib.pm
Of course, you'd put them in your own directories.

In reply to Re: (De)Compressing a text stream by bikeNomad
in thread (De)Compressing a text stream by unb0rn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.