and as your code is precisely written you could even drop the \Q! But many responders are (quite reasonably in my opinion) doubting that this is the solution you want. Such respondents might reasonably think that you mean to say you have a string that does contain the backslash just before you want to substitute it - "if the backslash weren't there you wouldn't have a problem in the first place," they might conclude.$line =~ s/\Q$line/country/;
It appears to me that we need convincing one way or another whether the real problem string you are presented with has a backslash in it or not.
One world, one people
In reply to Re: Regex doubt
by anonymized user 468275
in thread Regex doubt
by kprasanna_79
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |