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