Your search string is interpreted as a regular expression, and it contains regular expression meta characters. See perlre. Maybe you wanted to use quotemeta or \Q|?
$line =~ s/\Q$expr/$n_expr/;
In reply to Re: String substitution
by Corion
in thread String substitution
by abhay180
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |