I like Jeffa's answer, because the substitution pattern is easier to read.
Alternatively, I think you could get away with just adding the 'e' modifier after your 'g'. That tells s/// to evaluate the right side, rather than use it at face value.
In reply to Re: preserving html in patterns
by mrbbking
in thread preserving html in patterns
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |