Think about Loose Coupling | |
PerlMonks |
Reading Mail::Message objects using Mail::POP3Clientby TheHobbit (Pilgrim) |
on Oct 13, 2002 at 17:26 UTC ( [id://204920]=perlquestion: print w/replies, xml ) | Need Help?? |
TheHobbit has asked for the wisdom of the Perl Monks concerning the following question:
wise Monks, After some month away from the monastery, I'm back with a maybe interesting question. I'm developping a little application, one component of wich needs to download some mail messages from a POP3 account and do something with them according to data such as the From: address, the Subject header and (obviously) the contents. I got this idea to use Mail::POP3Client for doing the download, and it works fine. But now I do not want to reinvent the wheel just another time, so I though to use the Mail::Message class to do the parsing for me. Well, I'm unable to find a clean way to transform the string obtained by the HeadAndbody method of the Mail::POP3Client into a Mail::Message object (actually a subclass of it I defined). So here comes the question. Am I too a blockhead to find how to do that, or realy this operation is so difficult? Subsidiary question is: is there another way to parse a string conatining a mail message into some kind of structure allowing easy access to the different parts of the message? Thank you and may your regex only match when they have to. Leo TheHobbit
Back to
Seekers of Perl Wisdom
|
|