in reply to Replace Character Symbols with White Space
$string =~ tr/+/ /;
Example:
perl -e '$string = "+=+=+=+"; $string =~ tr/+/ /; print "($string)\n"; +'
...the output...
( = = = )
If it's possible that your data has legitimate '+' characters (perhaps escaped, or quoted), then you'll have to use a more elaborate solution.
I think that perlintro is required reading for anyone new to Perl, and while the tr/// operator isn't discussed therein, the s/// is. The s/// operator could be used (less efficiently than tr///) like this: s/[+]/ /g. So after reading through perlintro, while you might not have discovered the most efficient way of doing it, you would have gotten a good start toward coming up with a reasonable way of doing it.
Dave
|
|---|