Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

how to get "Subject" using MIME::Parser ?

by Anonymous Monk
on Jan 22, 2013 at 18:28 UTC ( #1014758=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hiya Monks...,

I need to get the 'subject:' using the MIME::Parser. How can I get that...?

We will get the body by using $data->{BODY}

Can I do it like this,   $data->{HEADER}; ? to get the subject, If not pls guide me through.

Thx in advance

Comment on how to get "Subject" using MIME::Parser ?
Download Code
Re: how to get "Subject" using MIME::Parser ?
by moritz (Cardinal) on Jan 22, 2013 at 18:59 UTC
Re: how to get "Subject" using MIME::Parser ?
by runrig (Abbot) on Jan 22, 2013 at 20:04 UTC
    We will get the body by using $data->{BODY}
    I do not think that will work.

    MIME::Parser's parse methods return a MIME::Entity object. You'd be better off reading the documentation for those libraries and using the documented methods to get the body and the other parts of the email that you require.

Re: how to get "Subject" using MIME::Parser ?
by mhearse (Hermit) on Jan 22, 2013 at 20:35 UTC
    Years ago I was archiving terabytes of email to a compressed mysql db. Since there is a great deal of duplication when dealing with email, this seemed like a good solution at the time. I became frustrated with MIME::Parser for several reasons, including the one mentioned in your post. This is probably because of my limited knowledge of perl.

    I'm ashamed to say that I ended up using python. And found email parsing a bit less cryptic.

Re: how to get "Subject" using MIME::Parser ?
by Anonymous Monk on Jan 22, 2013 at 23:46 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1014758]
Approved by herveus
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (14)
As of 2014-10-30 17:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (208 votes), past polls