develooper Front page | perl.beginners | Postings from February 2002

Multiple lines - I must be doing something wrong

Thread Next
From:
Marc Morrison
Date:
February 23, 2002 15:52
Subject:
Multiple lines - I must be doing something wrong
Message ID:
20020223235225.96608.qmail@web21204.mail.yahoo.com
I have an online form that has a "Comments" field.  I
need to extract ALL of the information from the
comments field.  

Each "Comments" line begins with Comment: so the
/^Comments/ works to match that, however the user may,
or may not enter a new line in their comments and they
may or may not start from the line where "Comments" is
written.

Also there are no delimiting characters to search. 
And one more problem is that they rarely end the
sentence with a period.  The only good news is that
there are never more than 4 lines.  But because there
is almost always a newline, I can't use:

while <>

because it searches line by line.

I posted on line and got a very helpful response to
use:

local $/ = undef;  

However I put this at the beginning of my script and
nothing matched.  I am still using the while<>.  Is
this what is messing it up?


Thanks!

MMM


__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About