Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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

Replies are listed 'Best First'.
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 (Chaplain) 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1014758]
Approved by herveus
[Corion]: Hah. I just had this idea for another EMACS backronym, but I still need to make it happen. "Eight Machines And Constantly Synching" - I envision a NodeJS+Kybernetes based infrastructure communicating between the syntax highlighter machine, the ...
[Corion]: ... screen render machine, the file store machine and five more (maybe for redundancy?), just to write print "Hello World"; ;)
[Corion]: Ah, maybe one machine could be the compiler host, which constantly compiles the Elisp to Javascript to serve to all the other machines running it...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2018-04-26 11:29 GMT
Find Nodes?
    Voting Booth?