in reply to perl remove mail(textfile) header(eg. title, from,Delivered-To,Received)

I would suggest that Mail::Internet would probably be a good module to use. It looks like it can give you just the body of the message.

And by the way, if you could wrap your example data (in this case, an E-Mail message, where line endings are relevant) inside code tags, it would be much appreciated. Thanks.

Alex / talexb / Toronto

"Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

  • Comment on Re: perl remove mail(textfile) header(eg. title, from,Delivered-To,Received)
  • Download Code

Replies are listed 'Best First'.
Re^2: perl remove mail(textfile) header(eg. title, from,Delivered-To,Received)
by stillcool (Initiate) on Apr 26, 2009 at 17:08 UTC

    tq now my query look more in arrange

    jus now i don noe how to put the mail example properly

    i am newbie in perlmonks

    i jus wan get the content of the mail start from

    Martin A posted:

    and calculate the total word that appears in the content...

      Having just now fiddled with Mail::Internet and failed to get it working, let me instead provide the following:

      #!/usr/bin/perl -w # # while(<>) { last if ( /^\s*$/ ); } print <>;

      Running this using the message as the input file will produce the output

      Martin A posted: Tassos Papadopoulos, the Greek sculptor behind the plan, judged that t +he limestone of Mount Kerdylio, 70 miles east of Salonika and not far fro +m 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 planned --------------------- 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 http://us.click.yahoo.com/pt6YBB/NXiEAA/mG3HAA/7gSolB/TM ---------------------------------------------------------------------~ +-> To unsubscribe from this group, send an email to: forteana-unsubscribe@egroups.com Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/ter +ms/

      as requested.

      Since the divider between the mail header and the mail body is just a blank line, this script should be dead easy for you. I highly recommend you get a good book that explains E-Mail in some detail, perhaps something from O'Reilly.

      A good book on Perl would also be an excellent investment.

      Alex / talexb / Toronto

      "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

        tq so much for ur guidance!!! really appreciate it for the

        #!/usr/bin/perl -w # # while(<>) { last if ( /^\s*$/ ); } print <>;

        thanks so much talexb ur code are so helpful^^

        if my email got html code how am i goin to exclude the html tag... the example mail with html tag

        <title>Cable companies cracking down on Wi-Fi</title>

        i only wan the contain after the html tag are remove so it would be

        Cable companies cracking down on Wi-Fi