Try $frage_text =~ s/\"/\\"/g; I think it will work better this way. 

Edvaldo Guimarães
Marketing Support - Latin America
UGS PLM Solutions Brasil
An EDS Company
Tel.: +55-11-4224-7153
Fax: +55-11-4224-7107


-----Original Message-----
From: Ash Singh [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 11, 2004 11:44 AM
To: 'Jan Eden'; Perl Lists
Subject: RE: Escaping quotes in variable content


Try this:
<input type=\"text\" name=\"frage_text\" size=\"100\" value=\"$frage_text\">



-----Original Message-----
From: Jan Eden [mailto:[EMAIL PROTECTED]
Sent: 11 May 2004 03:59 PM
To: Perl Lists
Subject: Escaping quotes in variable content

Hi all,

how can I escape quotes within a variable's content? I use the following
directive to fill an HTML form:

<input type="text" name="frage_text" size="100" value="$frage_text" />


Unfortunately, if $frage_text contains a double quote, the browser will stop
displaying the string at that point.

I tried to escape the quotes in a Perl way

$frage_text =~ s/"/\\"/g;

but that did not help.

 Any suggestion is appreciated.

 Thanks,

 Jan
--
Common sense is what tells you that the world is flat.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response> 


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to