I messed something up, for some reason my textarea is not saving the
text to a single line in the text file. I've got a standard text box
that users may hit the enter key to establish different paragraphs
within their post, however, for some reason it carries the CRLF down to
the variable and the text file I'm posting it all too, I know that this
is more html than PERL, but how do I remove the CRLF, and just have the
^M again? Help.

In Service,
Mark


-----Original Message-----
From: James Edward Gray II [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 10, 2003 5:36 AM
To: Mark Weisman
Cc: [EMAIL PROTECTED]
Subject: Re: Help with manipulating a string.


On Dec 10, 2003, at 1:39 AM, Mark Weisman wrote:

> I've got a multiline text box that will feed the ^M at the end of each

> line. I want to capture it into a single line (which is done), but how

> do I get it back? Not knowing how many lines there may be with the ^M 
> between them. Currently, I use the old standby:
>
>> foreach my $rec (@post) {
>>      chomp($rec)
>>      (Unknown here) = split(/\^M/,$rec);
>>      print "whatever I need printed\n";
>> };
>
> I'm not sure as to how to declare it, or if there is another way?

my @lines = split /\^m/, $rec;

Is that what you mean?  The split just returns a list of the lines, so 
we can stick that in an array.

James


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to