in reply to How do I stop this from removing spaces?
Scalars and arrays interpolate into regex expressions with the same rules as into double-quoted strings. Arrays interpolate with a separator string defined by the $" special variable, a single space by default. So the regex looks like
s/[* | < > ? /]//g
I.e., the character class contains a space.
join the array to a scalar with the empty string as the separator, then use the scalar in the regex.
|
---|