Thanks a lot for you answer, gzwrite is interesting :
open FFF, "<fu.txt" or die "$!" ; binmode FFF ; $gz = gzopen("fu.txt.gz", "wb") or die "gzerror" ; while ($buffer = <FFF>) { $gz->gzwrite($buffer) } close FFF ; $gz -> gzclose ;
The resulting file is a valid gz file.
I have to point out that i'm under win32, hence the binmode (otherwise newlines are washed out when i uncompress the file).

But, i have a problem here : what i need to obtain is a .Z file and not a .gz .
This might not be mandatory, but the resulting file is sent to someone else and i'll have to check if his programs can deal with a .gz .

Do you know if Compress::Zlib will allow me to create a .Z file ? For exemple with inflate / deflate ? Or is zlib for gz compression only ?

Thanks a lot,

ZlR .


In reply to Re^2: Compress::Zlib : what to do with the "in memory" data ? by ZlR
in thread Compress::Zlib : what to do with the "in memory" data ? by ZlR

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.