Your substitution operates on the contents of the $_ variable, but then you never do anything with that (potentially) modified variable. Did you not show a complete code example? I expected to see a print somewhere.