Hello Monks
I am so knew to Perl, so please bear with me!
I have some mailboxes that store all messages inside a
single file handle! Each message begins with...
##########
From name@domain.com time_sent
##########
There are other lines inside each message that start with
'From'!
Example....
mail header...
##########
From: name@domain
##########
The other 'From(s)' that are inside a message body that
start on a 'new line' are pushed out using a single '\s'
so that the message starting and ending point can always
be found!
example... (From contained in a message body)
#########
(space)From
#########
So knowing that information what would be the best way to
split each message! Only starting to learn Perl so I am
confused at what would be best to use to handle this! A
friend said to use index() and then store each postion in a
array! I tried that in a for() loop, but with over 50,000
messages in some mailboxes it seemed to be not the best way
to use (2) index() calls then a single substr() to grab
each message!
Thank You
Cookie
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.