3.3.1. Escape Sequences

We have already encountered the \n "escape sequence" which can come inside strings and designates a newline character. There are many others in perl. Here is a list of the most important ones:

Here's an example to illustrate some of them:

print "I said \"hi!\" to myself, and received no reply.\n";

print "This program will cost you \$100 dollars.\n";

print "The KDE\\GNOME holy war makes life in the Linux world " .
      "more interesting.\n";

whose output is:

I said "hi!" to myself, and received no reply.
This program will cost you $100 dollars.
The KDE\GNOME holy war makes life in the Linux world more interesting.

Written by Shlomi Fish