Yes. But remember that $ctl in that snippet is the equivalent of the OPs $pure, not the variable being cleaned.
Still, I guess they could legitimately contain meta chars. If the OPs $pure variable(s) are sourced from outside of his program or genuinely might contain meta characters, then a quotemeta would probably be appropriate.
Indeed, it might be good if that were mentioned in the eval tr example in perlop.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] [select] |
It just struck me that you can avoid having to use the quotemeta function by using metacharacter form:
eval "\$ex =~ tr[\Q$ctl\E][]cd;";
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] [d/l] |