Look at this example: [url]http://stackoverflow.com/questions/125171/passing-a-regex-substitution-as-a-variable-in-perl[/url]