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

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...

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

Replies are listed 'Best First'.
Re^3: perl remove mail(textfile) header(eg. title, from,Delivered-To,Received)
by talexb (Chancellor) on Apr 26, 2009 at 18:51 UTC

    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

        I can't recommend any module in particular -- a quick look on CPAN shows HTML::Strip as the first module I found that might do the job.

        While it's tempting to say, "Hey, I can do that with a regular expression!", you'll probably find that it rarely works as well as you expect.

        HTML E-Mail sometimes contains the HTML version of the message in one section, and the text only version in another section -- you might want to check that out as well.

        Alex / talexb / Toronto

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