I'm trying to implement a standard protocol (
RETS, to be specific) which defines certain responses as MIME multipart/parallel entities with CR/LF line endings for headers, with some MIME entities containing binary data. I'm trying to get CR/LF line endings out of
MIME::Entity, but it's full of hardcoded
\n characters, and so far I don't have a solution I'm happy with. Here's what I've tried:
- Writing the MIME entity to a filehandle with the :crlf PerlIO layer enabled. The binary parts get mangled by :crlf, and also the Content-length header ends up incorrect.
- Editing MIME::Entity and MIME::Head on my system. This is difficult to maintain, especially if I try to install the code on another machine.
- Subclassing MIME::Entity and MIME::Head to output CR/LF line endings. There are unfortunately a lot of places where \n is hardcoded in, and other places where MIME::Head objects are created explicitly, which must be replaced with my special subclass. I end up duplicating large blocks of code just to change a few variables, and I'm afraid this will be just as difficult to maintain as customized local copies, and also fragile when the MIME modules are upgraded.
Does anybody have any other suggestions? Thanks!
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.