But it isn't changed. When I remove the ( and ) the replacement works well, but I've no influence on the inputstring. So what I want to achive is that $t is handled as a "exact search string" and not as a to be interpreted regular expression. Help is very appreciated.#!/usr/bin/perl $inputstring=qq{startstring <strong>(substring)</strong> endstring}; $t=qq{<strong>(substring)</strong>}; $r=qq{<b>(substring)</b>}; $inputstring=~s/$t/$r/; print $inputstring; #The final string should be: startstring<b>(substring)</b> endstring
In reply to replace not working as expected by digirent
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |