That would probably work, but I'm never quite sure that there is any benefit to pre-compiling a regex with qr// if you are going to then interpolate that into the m// or s/// construct to use it.
Especially when the use as a hash key converts it back to a plain string anyway.
But, what am I missing about the benefit over quotemeta? Iff you want to have a replacement like 'a[0]' => 'a[1]', you either have to run it through quotemeta or escape it by hand if you want to use qr//, don't you?
In reply to Re^4: reg. expr. multiple substitutions
by mbethke
in thread reg. expr. multiple substitutions
by silentius
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |