Because despite being told that s modifies the string it's working on in place you persist in attempting to use its return value (the number of substitutions made) as something meaningful ($_ contains the converted string; you would want to append the contents of $_ to your accumulated buffer instead). Not to mention you're still trying to use + as a concatenation operator rather than the correct . operator.
Update: Oop, you're using s/// instead of tr/// but the point's the same (that it modifies the string in place and doesn't have a meaningfull (in this instance) return value). Wording changed accordingly.
And it's just been pointed out to me that that line wasn't yours, which only partly excuses you in that you cargo cultly included it without understanding that it was doing the very thing you'd already been warned about.
The cake is a lie.
The cake is a lie.
The cake is a lie.
In reply to Re^3: Removing characters
by Fletch
in thread SOLVED Removing characters
by Slug
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |