in reply to Re: Force interpolation on singel quoted strings
in thread Force interpolation on singel quoted strings

The * does need escaping. Not because it's in single quotes, no, the string is in single quotes because he wants the backslash there! The backslash is there to make the regex engine match an asteriks.

The way to go is not to force interpolation, but to go the other way around. Do something like:

my $printtag = "/* <sometag */"; my $matchtag = quotemeta $printtag;
Or (probably more convenient), to just have $printtag and surround that with \Q and \E when putting it in the regex.

Abigail