This particular scheme fails if you allow a variable named '0' though, so you may need to do something else in the replacement part if this is the case.
Yes. In that case, your "$1||$2" would have to be "defined $1 ? $1 : $2".
In reply to Re^2: How do I avoid double substitution when replacing many patterns?
by kyle
in thread How do I avoid double substitution when replacing many patterns?
by kyle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |