vxp has asked for the wisdom of the Perl Monks concerning the following question:
Suppose you have the following input (MIME encoded):
--_000_200907060005UAA14932pisas291mscom88clm_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable line1 line2 line3 --_000_200907060005UAA14932pisas291mscom88clm_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> ...insert random MIME-ed html code here --_000_200907060005UAA14932pisas291mscom88clm_-- --_004_38D25DCAD7370B4FACA079E2FAA2C690B02CB5NYWEXMB24msadmsco_--
Another thing about this is that the input is not consistent in the sense of order. Sometimes the plain text mime can be on top and the html mime on the bottom, and sometimes it can be vice versa.
the reason I'm mentioning that, is because that makes it impossible to parse the message by reading the input from the top until you see "Content-Type: text/html", and placing it into a $txt_section for instance and then reading the file from the bottom (by File::ReadBackwards for instance) and placing that into a $html_section or something.
so I'm looking for a CPAN module, I'm assuming, that I can instruct to "get me the 'text/plain' section out of this input" or "place the 'text/html' section of that input into @array".
Any suggestions for such a module, or may be an alternate solution to this ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: MIME voodoo.
by zwon (Abbot) on Jul 16, 2009 at 18:32 UTC | |
by vxp (Pilgrim) on Jul 16, 2009 at 18:56 UTC | |
by zwon (Abbot) on Jul 16, 2009 at 19:05 UTC | |
by vxp (Pilgrim) on Jul 16, 2009 at 19:37 UTC | |
by zwon (Abbot) on Jul 16, 2009 at 20:00 UTC | |
|