C:\>perl $pattern = "\\"; $variable = "abcde\\fg"; print $variable =~ /$pattern/; ^D Trailing \ in regex m/\/ at - line 4.