tr// is a one-to-one transformation, meaning there (should be) the
same # of characters in each operand. Thus, the line:
$value =~ tr/+/"\ \;"/
will be interpreted as "translate a + sign to a quote, then
translate... oops, all done!" since there's only the plus sign on the
left.
Try:
$value =~ s/\+/\ \;/g;
to get the desired effect. Note the \+ in the construct above.
MAC
"Peter Smith" <ps*****@SparnBlock.bigpond.net.au> wrote in message news:<aw******************@news-server.bigpond.net.au>...
Hi
I am writing a message board, and the text is entered in a text box and
outputted in HTML. How can I keep the spaces formatting (ie use 's)
in the html output??
I use the standard decode lines:
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
but when I use
$value =~ tr/+/"\ \;"/;
I get repeated &'s instead of spaces. Any help much appreciated..
- Peter