[PLUG] Perl is EVIL!!

jm jack at endofhistory.com
Fri Oct 31 17:42:02 UTC 2003


begin electrogrammati illius AthlonRob:
> ...too bad it's just the right tool for some jobs.
> 
> I'm trying to extract rfc/822 attachments out of emails.  Forwards. 
> Easier said than done, I'm finding.
> 
> I'm making progress, but have hit a major stumbling block, I can't get
> the last boundary to NOT print.  It just absolutely wants to print, no
> matter what.  Well, that isn't accurate.  It wants to print, no matter
> what, if the attached message uses MIME, itself.  If the attached
> message is all plaintext, then the bottom boundary does *not* print, as
> it should be.
> 
> I'm stumped.  Any ideas?  This is the *first* perl script I've ever
> written, so be gentle.  :-)

Hiya, this won't help if you're determined to do it "the hard way",
but there's a handy perl module called MIME::Parser that's designed
to do exactly this extraction, and will save you a lot of grief. It
is part of the standard MIME-Tools suite. "perldoc MIME::Parser"
seems to have much sample code.

-jm

-- 
"No doubt Dylan Klebold and Eric Harris would never have embarked on
their murderous rampage if the principal had been allowed to post THOU
SHALT NOT KILL next to the football schedule."--Dan Kennedy, Boston Phoenix, 2 July 1999




More information about the PLUG mailing list