Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
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

In reply to Mail::Internet question by Anonymous Monk

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2022-07-01 17:07 GMT
Find Nodes?
    Voting Booth?
    My most frequent journeys are powered by:

    Results (99 votes). Check out past polls.