Perl string escape characters

From NixTheWorld

Jump to: navigation, search
\n Newline
\r Carriage Return
\t Tab
\f Formfeed
\b Backspace
\u Converts next letter to uppercase
\l Converts next letter to lowercase
\U Converts following text to uppercase
\L Converts following text to lowercase
\E Terminates all \U or \L's
\\ Allows for the display of a backward slash
\' Allows for the display of a single-quote character
\" Allows for the display of a double-quote character
  • There is an exception to the rule that single-quoted strings do not support escape characters. That is when you are using \' or \" inside a single-quoted section. e.g., by rule, 'This is Bob's home.' would not be proper, as the ' after Bob would close the section; however, 'This is Bob\'s home.' - despite the fact that single-quotes should display what is in them, will, in fact, display This is Bob's home. properly.
See also
Perl
Personal tools