http://www.perlmonks.org?node_id=1027281


in reply to regex error

Use /\Q$variable\E/ when you want to literally match the contents of a variable. More info is at the end of Quote and Quote like Operators, in quotemeta (as suggested above) and in Interpolation.