Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Counting text area

Thread Tools

Counting text area

Gunnar Hjalmarsson
Posts: n/a
John S wrote:
> Gunnar Hjalmarsson wrote:
>> John S wrote:
>>> textarea comes back with \r as well.

>> Only on Windows (of course), and not if you use a library that
>> takes care of it, such as (as Tore suggested) or
>> Otherwise you can binmode STDOUT to prevent the \r
>> pecularity.

> When this is run from an Apache server:


> my $fe = $q->param( 'friend_email' ); # text area
> my $msg;
> if ( $fe =~ /\r/ ){
> $msg = 'found \r'
> }


> print $q -> p( $msg );


> I get 'found \r'.

Okay. But don't you mean when a textarea field with linebreaks is
submitted from a Windows browser?

The problem I was talking about (which is related) is that if you
display a textarea field with embedded text in a Windows browser, and
the text includes \r\n linebreaks (which it typically does if the
script is run on Windows), each occurrence of \r *or* \n appears to be
exchanged for \r\n before display. In other words, if you don't
binmode STDOUT, the numbers of linebreaks are doubled.

This sub-thread seems to have turned off topic.

Gunnar Hjalmarsson
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
MVC2: linking from one area view to another area view Andy B. ASP .Net 0 04-30-2010 07:46 AM
do structure definitions go in data area or in code area... hotadvice C Programming 14 10-02-2007 04:10 AM
Controlling text in a Text Area or Text leo ASP General 1 12-05-2005 01:13 AM
counting up instead of counting down edwardfredriks Javascript 6 09-07-2005 03:30 PM
Add point to graphics area without having to paint the whole area? Mark Java 1 06-27-2005 03:09 AM