Any help on this poser would be most appreciated
I am trying to use Mail::Internet to split an inbound email on STDIN into it's body and header parts so I can store what I need in a database.
I can deal with the header no probs but the body part is driving me up the wall, even though the documentation makes it sound simple.
The 'body' method should be a reference to an array containing the lines of the message body. Here is a sub I knocked up to parse the message.
sub parse_message {
$message = new Mail::Internet \*STDIN;
$sender = $message->head->get("From");
@content = $message->body();
$content = join('\n',@content);
}
All I get in
$content or
@content is something like ARRAY(0x8217224);
I know I'm probably overlooking something very basic here, can anybody help?
Many thanks
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.