in reply to Re: Problem using value of variable in a regular expression
in thread Problem using value of variable in a regular expression

And some other ways:
my $failmsg = '\*E'; # Single quotes prevent interpolation my $failmsg = '[*]E'; # Character class makes it not special. my $failmsg = "*E"; if (index($_, $failmsg) >= 0) # Don't use a regexp.