in reply to Recognizing duplicates
The numeric variables ($1 etc.) are only set on the right hand side of a substitution. You need to use the corresponding backreference (e.g. \1) on the LHS of a s/// or in a m//. See perlretut and perlre, the former of which uses this exact problem as its example.
|
|---|