Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removal of special characters

Status
Not open for further replies.

tecknick

Programmer
Aug 23, 2002
7
AU
Hi

I have a perl cgi form which allows users to ask for information to be emailed to them. The request is appended to a comma delimeted file for use on a database. I am having a problem with users writing their request in Microsoft Word for Windows and cut and pasting it into my form. I get the following :


Instead of :

jack; jill; Please send information regarding.


I get :

jack; jill; Please send
information
regarding.


Does anyone have any advice?

Are ther any special characters which I should know about?

Regards

Tecknick
 
Try,
#!/usr/bin/perl
$msg="jack; jill; Please send
information
regarding";

$msg=~s/\n//g; remove newlines
$msg=~s/\s+/ /g; replace spcaes with a space
print $msg;

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top