in reply to left side of pattern matching

Literal regexes actually get 3 passes. The first pass, equivalent to single-quoted literals, just processes delimiters, plus backslash-delimiter and backslash-backslash to find the end of the string and extract it.

The second pass (equivalent to double-quoted literals) splits the string up into chunks of constant string mixed with variable access, \U etc; for example, "ab$c\Ud" gets converted into 'ab' . $c . uc('d'). For a normal double-quoted literal string, it would at this point also process all backslashy stuff, e.g. \n, \x{100}; however, for a regexp literal, this part is skipped.

Finally for regexps only, in the third stage the assembled string is passed to the regexp engine to be compiled. Here, the two characters \ and n are converted into a regexp op to match a newline, etc.

Note the difference this can make depending on whether it's a regex literal or a string literal:

$foo =~ /\b/; # matches a word boundary $foo =~ "\b"; # matches a backspace
Similarly,
$s = '\n'; # note that's 2 chars, not a newline "\n" =~ /$s/; # matches

Dave.