Use the $1 form anywhere else, including the right half of a s/// operator.
In your case, you will have to eval the results, but that's pretty easy: express the right hand as an expression, and add the /e option twice to your s/// operator. (This will require careful attention to tainting if you're security-conscious.)
--
[ e d @ h a l l e y . c c ]
In reply to Re: Regex prob with interpolated patterns
by halley
in thread Regex prob with interpolated patterns
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |