CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
perl remove mail(textfile) header(eg. title, from,Delivered-To,Received)


New User

Apr 26, 2009, 6:14 AM

Post #1 of 1 (617 views)
perl remove mail(textfile) header(eg. title, from,Delivered-To,Received) Can't Post

currently I am doin anti spam with perl

i wan to remove header of the email (title, from,Delivered-To,Received etc) to increase my accuracy...

how can i do it?? can anyone help me??

i wan get the contain starting from "Martin A posted:" till the rest of the mail so the header word will not include in total word that contain in the mail... below is some of my code to get full word count(698 words total) of the mail.

i copy and paste the mail into textfile and use textfile to handle it

use strict;
use warnings;
my $count=0;open(FILE, "C:/Perl/testfile.txt");
while(<FILE>) #count the total words
$count++ while m/[a-zA-Z]\w*/g;}print "total word = $count \n";

this is the sample mail

From Thu Aug 22 12:46:39 2002
Return-Path: <>
Received: from localhost (localhost [])
by (Postfix) with ESMTP id BE12E43C34
for <zzzz@localhost>; Thu, 22 Aug 2002 07:46:38 -0400 (EDT)
Received: from phobos []
by localhost with IMAP (fetchmail-5.9.0)
for zzzz@localhost (single-drop); Thu, 22 Aug 2002 12:46:38 +0100 (IST)
Received: from (
[]) by (8.11.6/8.11.6) with SMTP id
g7MBkTZ05087 for <>; Thu, 22 Aug 2002 12:46:29 +0100
Received: from [] by with NNFMP;
22 Aug 2002 11:46:30 -0000
Received: (EGP: mail-8_1_0_1); 22 Aug 2002 11:46:29 -0000
Received: (qmail 11764 invoked from network); 22 Aug 2002 11:46:29 -0000
Received: from unknown ( by with QMQP;
22 Aug 2002 11:46:29 -0000
Received: from unknown (HELO (
by with SMTP; 22 Aug 2002 11:46:29 -0000
Received: from exchange1.cps.local (unverified) by (Content Technologies SMTPRS 4.2.10) with
ESMTP id <> for
<>; Thu, 22 Aug 2002 13:14:10 +0100
Received: by exchange1.cps.local with Internet Mail Service (5.5.2653.19)
id <PXX6AT23>; Thu, 22 Aug 2002 12:46:27 +0100
Message-Id: <5EC2AD6D2314D14FB64BDA287D25D9EF12B4F6@exchange1.cps.local>
To: "''" <>
X-Mailer: Internet Mail Service (5.5.2653.19)
X-Egroups-From: Steve Burt <>
From: Steve Burt <>
X-Yahoo-Profile: pyruse
MIME-Version: 1.0
Mailing-List: list; contact
Delivered-To: mailing list
Precedence: bulk
List-Unsubscribe: <>
Date: Thu, 22 Aug 2002 12:46:18 +0100
Subject: [zzzzteana] RE: Alexander
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Martin A posted:
Tassos Papadopoulos, the Greek sculptor behind the plan, judged that the
limestone of Mount Kerdylio, 70 miles east of Salonika and not far from the
Mount Athos monastic community, was ideal for the patriotic sculpture.

As well as Alexander's granite features, 240 ft high and 170 ft wide, a
museum, a restored amphitheatre and car park for admiring crowds are
So is this mountain limestone or granite?
If it's limestone, it'll weather pretty fast.

------------------------ Yahoo! Groups Sponsor ---------------------~-->
4 DVDs Free +s&p Join Now

To unsubscribe from this group, send an email to:

Your use of Yahoo! Groups is subject to


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives