Stings - textareas in Perl...

J

joesplink

This seems odd.

Indeed. The second example is clearly bugged.... and why my strings
were growing. However, the first example, which seems kosher to me,
causes me to lose trailing cr-lf's. But, wait a minute..... I actually
prefer to get rid of those trailing cr-lf's anyhow....and have added a
little code to do it explicitly (courtesy of my Perl book)....so, I can
live with the first version....especially since I won't have to .....

Thanks for your help.
 
D

David H. Adler

The reason I convert the lf's before writing to disc is because I want
to read the disk file with

my @array = <DATAFILE>;

and if I write the string with embedded lf's it will come back as
multiple array elements.

Not if you do it right. Look at the perlop page under $/.

dha
 
J

Joe Smith

joesplink said:
Even if I set my $Field="A\r\l\r\l" I still get back only "A"......

Don't blame perl for that: the behavior is browser specific.
And it's "\r\n" not "\r\l".
So, (at least part of) the problem is I don't know exactly what string
Perl is sending to the browser in the above instances.

You mean you've never used the brower's View Source feature?
 
J

Joe Smith

joesplink said:
"Why don't these 2 snippets send the same output to the server?"

Don't you mean "from the server"?
"exactly what do these scripts send to the server?"

Send to the _browser_.

The perl answer to that is 'use LWP::Simple;'.
-Joe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top