MIME::Entity/Head annoyance

TeeJay on 2003-11-24T19:40:52

I am writing some code to handle SOAP with Attachments ( as needed by ebXML ) which uses MIME.

Fine, I think.. no problem thats all standard internet stuff the perl community will have dealt with plenty.

Nope. No mention of MIME in the SOAP::Lite perldoc, you need to check out the SOAP::Mime docs instead.

Not a problem, works fine.

The problem comes to when I use MIME::Parser to extract the MIME stuff at the other end - MIME::Parser doesn't directly deal with headers, it just parses it into a MIME::Entity object, which then holds the header in a MIME::Head object.

Fine, nice object oriented encapsulation.. except..

There is no way to get several important headers through the accessors, because at some point one of the modules throws them away!

For the love of god, why?!?

If you want to get the Content-Id from a part of a multipart message, you have to stick your fingers into the guts of objects inside objects and pull the value out from a hashref hidden deep inside.

gah!!!!


and who uses $me anyway?

TeeJay on 2003-11-24T20:02:39

bah.

unlike $self or $this which are programmed into my brain, $me doesn't really shout (hello, I'm the current object that this method was called on, etc).

the internals of Mail::Internet are nasty and as the fix I tried to make Content-Id appear didn't have any effect I am not at all tempted to write a proper patch.

MIME::Entity to blame

TeeJay on 2003-11-24T20:13:35

looks like its MIME::Entity's fault

between fetching the MIME::Head myself manually, and through the M::E accessor, it sheds a load of headers that I want to use.

Very annoying.