According to the Compress::LZV1 docs:

Try to compress the given string as quickly and as much as possible. In the worst case, the string can enlarge by at most a single byte. Empty strings yield empty strings. The uncompressed data string must be smaller than 16MB (1<<24).
(my emphasis added)

The module is indeed "compressing" your data, as can bee seen by the U at the start of the compressed string.

From what I remember, LZV-type compression is a dictionary-based algorithm. Without getting too deep into compression, this means that a dictionary is used to map out "compressable" portions of the message. This dictionary takes up a certain amount of space (say, 100 bytes). If the size of the data to compress is already smaller than the size of the dictionary, actually compressing the data will give a net increase in the size; not what you wanted. The implimentation of the algorithm used in the Compress::LZV1 package is smart enough to realize this fact and stores the string with a flag denoting that the string is uncompressed. This gives a net increase of one byte to the data, which is definately better than adding 100 bytes to the message.

You're not doing anything wrong, as far as I can tell, other than using too small of a bit of data. Try increasing the amount of data you're using and see if that helps.


In reply to Re: How to use Compress::LZV1 by tadamec
in thread How to use Compress::LZV1 by kleinbiker7

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.