next up previous contents
Next: Arrays Up: Scalar Variables Previous: Defining Scalar Variables

String Scalar Variables

Strings are a sequence of characters. Perl has two types of string:

Single-quoted strings
-- denoted by '....'. All characters are regarded as being literal characters.
That is to say special format characters like \n are regarded as being two characters \ and n with no special meaning.

Two exceptions:
Double-quoted strings
-- Special format characters now have a special meaning.

Some special format characters include:

\n      newline
\r      carriage return
\t      tab
\b      backspace
\\      backslash character
\"      double-quote character
\l      lower case next letter
\L      lower case all letters until \E
\u      upper case next letter
\U      upper case all letters until \E
\E      Terminate \L or \E



dave@cs.cf.ac.uk