On 3/2/06, maillists <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to filter quotes out of a web form and replace them with > " > > $Values->{text_field} =~ s/"/"/; > return; > > However, This does not seem to work. Is this right? > Also, I would like to replace the single quote ' > > Thanks > Rick
What do you mean by "does not seem to work"? The see the following test code and output. code #!/usr/bin/perl my $var = qq(this has "foo" style quotes); print "$var\n"; $var =~ s/"/"/g; print "$var\n"; output this has "foo" style quotes this has "foo" style quotes As for replacing single quotes, if you wish both to be " (a gramatical error in nested quotes) then you can use $var =~ s/["']/"/g; Otherwise you will need a second substitution $var =~ s/"/"/g; $var =~ s/'/'/g; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>