parsing email to get required information using perl script

Hi,


I am new to perl and i need some help in parsing email's using some perl script and get required information

Below is the sample email format in the logfile

From Mon Apr 14 20:24:14 2014
Return-Path:
-----------------
--
----
-----
--------
Date: Mon, 14 Apr 2014 13:23:06 -0700
Message-Id: <201404142023.s3EKN6LQ016845@xxx.com>
From:
To:
Subject: WARNING :
X-Priority: 1
Content-type: text/html
X-Milter-Version: master.31+4-gbc07cd5+
X-CLX-ID: 507038003
Reply-To: -----
X-Loop: ----
X-Sequence: 197227
Errors-to: -----
Precedence: bulk
X-no-archive: yes
List-Id: <---->

< Body of the email >


in log file we have lot of emails and we need to skip email's which has reply

I need below information

Date:
Message-Id:
From:
Subject:

Email start with From at the start of the line


can any one help me with the sample code

Well A long way From home

Well I am a long way from home today and of course I had to check in and look at a few things.

Well No problem with the modern web just connect in from anywhere in the world and do your work.

Well my internet connection is 34kb so not very broad as well I using my cousin's computer but at least I can get my google mail and use good old ftp if I need to copy anything to and from the remote site

Well that is all great and good but I had to do some very quick debugging on a web site I sometimes help maintain. Well with the very limited connection speed I was timing out over the ftp but after 20min I finally got the offending file downloaded.

Views in DBIx::Class

Did you know you can write a view in DBIx::Class? The DBIx::Class::ResultSource::View module makes this very easy and it's helped me solve a very thorny problem in Veure: how do I efficiently make sure that email sent from Alpha Centauri to Epsilon Eridani doesn't show up instantly in your inbox?

Improving the grant program (2) Bi-monthly Grant Cycle

Continued from the previous post.

From the comments to Alberto's post:

The 3-monthly call for grants, and the 1 month taken to assess grants, means that there is a 1-4 month lead time between "now" and when a proposal can be accepted.

Now we have a bi-monthly cycle, +50% added frequency, the lead time between "now" and when a proposal can be accepted can be as short as 3 weeks. Or 3 weeks + 2 months at the longest (announcement).

Should we make it monthly? Certainly yes if we have more applications. If we get a lot more proposals every two month, it will be appropriate to make it more frequent.

Bi-weekly cycle? Well, the Committee Secretary needs a break :)


Frequently anticipated questions

So the lead time is between (x weeks) and (x weeks + y months). Any views to make x smaller?

Right. It is easy to decrease y by increasing the voting frequency. However x is a different story.

OT: PLOS ONE Has an RSS Feed

If you like to follow academic progress in CS, PLOS ONE has an RSS feed. (I don't know my feed types upon inspection -- it might be Atom rather than RSS. Still nice to have the feed, though.)

Gluu fer the Wëëbb Part 2

Well in my first post of this series I just managed to get a listing up and running utilizing the Toto plugin well lets move on a little.

Well it seems I have my list and the underlying urls I have 'http://localhost:3000/character/view/Glarp_Gnlnarn' which is correct but of course it is not a 100% 'REST' as I think that by convention 'character' should be the plural 'characters' but then again in the POD they say this is a BREAD interface not a REST and the author defines it as

'- in a BREAD application, browse and add are operations on zero or many objects, while edit, add, and delete are operations on one object'

Ok I can buy that so back to doing some code.

Well back to doing a little coding.

So this time out I again start with my route and sub

Maintainer's Notes on rt.cpan.org

If you are a CPAN author, this is for you. Otherwise it's still time to become one!

RT.cpan.org has a little known feature called Maintainer's Notes. Maintainers of a CPAN distribution can put a piece of HTML above the tickets list.

Introducing fsql and chart

These are two command-line utilities to help you slice/dice and visualize data on the console. fsql utilizes DBD::CSV and a few other modules to let you perform SQL queries against CSV/TSV/LTSV/JSON/YAML files. chart generates simple ASCII charts. I'll give an example for using these tools.

Viewing monthly CPAN releases activity

I maintain a file called releases.txt in the LTSV format. Whenever I do a release, this file gets updated with a new entry.

Finding out how many releases I've done, or even how many releases for a specific year/month/day, is easy. The good ol' Unix commands like grep and wc suffice:

% wc -l < releases.txt
2746

% grep date:2014-03 releases.txt | wc -l
91

But what about something a little more advanced? What if I want to know which month I've done the most releases? Enter fsql:

About blogs.perl.org

blogs.perl.org is a common blogging platform for the Perl community. Written in Perl and offering the modern features you’ve come to expect in blog platforms, the site is run by Dave Cross and Aaron Crane, with a design donated by Six Apart, Ltd.