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: Beginner:
Is there a simple solution to this?


New User

Sep 10, 2004, 6:09 PM

Post #1 of 2 (232 views)
Is there a simple solution to this? Can't Post

I have a script which processes email and enters data into a database. The emails being processed are formatted
Field1: data
Field2: data
etc with each Field starting on a new line.

Most fields are being processed correctly but fields which run onto more than 1 line are not being correctly processed.

The code which processes the fields is

if (/Field1: /) { $field1 = $'; }

How do I change this to include data on the next line(s) or to include all data between "Field1:" & "Field2:" ?


Thaumaturge / Moderator

Sep 14, 2004, 4:11 AM

Post #2 of 2 (212 views)
Re: [Takshaka] Is there a simple solution to this? [In reply to] Can't Post

How do you recognise that one line is a continuation of the previous one? There must be some way to tell continuations from other lines. You'll just have to write some code that does that recognition and only write the data record once you're sure that you've got it all.

Dave Cross, Perl Hacker, Trainer and Writer
Get more help at Perl Monks


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

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