My second question lies in making these strings more complicated -- to the point of containing regular expression metacharacters.tr/// does not support regular expressions:
Note that tr does not do regular expression character classes such as \d or :lower:. The tr operator is not equivalent to the tr(1) utility. If you want to map strings between lower/upper cases, see lc and uc, and in general consider using the s operator if you need regular expressions.
Obviously I need to escape them,If you do end up using s///, you can escape the regular expression using quotemeta.
Is there a default module which does such escaping, or is there a CPAN module which does what I need?Probably. Can you show more small examples of what you are trying to replace?
In reply to Re: doing tr/// on-the-fly?
by toolic
in thread doing tr/// on-the-fly?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |