What kind of special characters (sequence characters) can I use in Perl strings?

By Alvin J. Alexander, devdaily.com

I won't say that this is a complete list, but I think this is a list of the most popular backslash characters (also known as escape sequences) that can be used in Perl strings. 

Character Sequence What it Matches
\a Alert/alarm/bell
\b Backspace
\D A non-digit
\e ESC character
\f Form feed
\n Newline character
\r Carriage return
\cC <Ctrl>C
\t Tab


You can use these "special" characters (such as the [Tab] character) simply by putting them inside of Perl strings, like this:

  print "Here is a tab\t and then a form feed\f and maybe a bell\a\n";


devdaily logo