in reply to Re: Re: uuencoding to deal with line breaks
in thread uuencoding to deal with line breaks
Uuencoded output will always be larger than the input because what you're doing is mapping the 8-bit character set into a smaller one (6-bits?).
If you want to compress your data, use Compress:Zlib (or maybe some form of `gzip -cf`) and uuencode the compressed data like before.
If that's still too big for you (or if you like complications), you can save your data as
$when|$to|$from|$subject|$body_length|$binary_compressed_body";
and use read or sysread to read $binary_compressed_body.
Come to think of it, if the formatting of the body is important to you, why not just save the number of lines in the body as the 5th data field rather than the body itself and have the exact body text follow it? So it would look like
$when|$to|$from|$subject|$lines_in_body $body # could be multi-lined
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: uuencoding to deal with line breaks
by epoptai (Curate) on Dec 19, 2000 at 04:51 UTC |