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

Multiple lines - I must be doing something wrong

Thread Next
Marc Morrison
February 23, 2002 15:52
Multiple lines - I must be doing something wrong
Message ID:
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

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

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?



Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About