Problems with PERL (now that's new!)

Ken Elliott's picture

They have: 358 posts

Joined: Jun 1999

Hello again.
How does TWF format their postings so that they maintain the <br> and <p> when the user presses enter.

Also I am adding a string of information to a hidden field. But the page formats the text in the hidden field when the user presses enter. I think if I could find a correct way to format the postings then I would be fine.

VulKen
Keepin' It Realistic

Pimpin like a pimp with an electrofied pimpin machine!

Ken Elliott's picture

They have: 358 posts

Joined: Jun 1999

Judging by how long this post has gone without a reply I will attempt to make my dilemma clearer. Here goes...

Ok, I have a script. It lets me add stuff to my websites. I have it run through a test script that prints it out as it would appear. The script is supposed to also put the information within a hidden input tag. The problem is when the browser shows the contents of the hidden input tag, whereever I press enter it inserts a /n = newline. I know I could avoid the problem by not pressing enter but I also want other people to be able to use the script.

How do I keep it from adding a newline when the user presses enter. Or can I possibly format it so that when the user presses enter it inserts a <br> instead of a /n.
Doubt that is possible but hey the easier the better.

Hope that I made my problem more clear.

VulKen
Keepin' It Realistic

Pimpin like a pimp with an electrofied pimpin machine!

They have: 850 posts

Joined: Jul 1999

You could use the s/// regular expression to search for any new lines (\n) and switch them to <br>'s.

$html =~ s/\n/<br>/g;

------------------
click here to help save lives
http://www.wiredstart.com : The Technology Start Page

Ken Elliott's picture

They have: 358 posts

Joined: Jun 1999

you da man/woman...whatever. I'm not taking any chances. hehe. Thanx.

VulKen

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.