The $2 is being interpreted by perl. Put a backslash before it and you should be good to go.
Turning on warnings is what gave me the hint to tell me why this wasn't working.
In reply to Re: Unwanted interpolation in backquoted string
by sgifford
in thread Unwanted interpolation in backquoted string
by mhearse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |