Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
There's more than one way to do things
 
PerlMonks  

Re: fixing what textareas do to input

by Zoogie (Curate)
on Jun 05, 2000 at 04:42 UTC ( [id://16360]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to fixing what textareas do to input

Perhaps: $data =~ s/(\r\n|\n\r|\r)/\n/g This converts CR's, LF's, and any combination of the two into a single newline (I hope... haven't tested it).

Replies are listed 'Best First'.
RE: Re: fixing what textareas do to input
by antihec (Sexton) on Jun 05, 2000 at 10:27 UTC
    If you output the textarea input in HTML you might consider changing the right hand side of Zoogies regexp to /<br>\n/g
    -- bash$ :(){ :|:&};:
RE: Re: fixing what textareas do to input
by mcwee (Pilgrim) on Jun 05, 2000 at 20:40 UTC
    Would $data =~ s/(\r|\n){1,2})/\n/g work as well? (Unfortunately, I don't have time to test it out-- and I'm notorious for FUing my regexes the first time out.)

    The Autonomic Pilot

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://16360]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.