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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Is there a simple solution to this?

 



Takshaka
New User

Sep 10, 2004, 6:09 PM

Post #1 of 2 (223 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:" ?

Thanks



davorg
Thaumaturge / Moderator

Sep 14, 2004, 4:11 AM

Post #2 of 2 (203 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
http://www.dave.org.uk/
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