
japhy
Enthusiast
May 10, 2000, 5:56 PM
Post #9 of 10
(785 views)
|
|
Re: removing carriage returns and pipes from a form entry.
[In reply to]
|
Can't Post
|
|
Your main problem was you were using single quotes around a variable. You did <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> $hash{'$var'} </pre><HR></BLOCKQUOTE> when you should have just done <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> $hash{$var} </pre><HR></BLOCKQUOTE> That was (more or less) the cause of all your grief. If you want to remove all newlines and pipe signs from a variable, I suggest <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR> $scalar =~ tr/\n|//d; $array[$index] =~ tr/\n|//d; $hash{$key} =~ tr/\n|//d; </pre><HR></BLOCKQUOTE>
|