
| Contents |
|||||||||||||||||||||||||||||
| [an error occurred while processing this directive] |
2.1.3.3 Examples of Interpolation (ASCII Octal Values)With the exception of `\n', you should note that the interpolated sequences are simply shortcuts for actually ASCII characters that can be expressed in other ways. Specifically, you are permitted to use the actual ASCII codes (in octal or hexadecimal) to represent characters. To exemplify this, consider the following program:
#!/usr/bin/perl use strict; use warnings; print "A backslash: \134\n"; print "Tab follows:\11over here\n"; print "Ring! \7\n"; print "Please pay bkuhn\100ebb.org \04420.\n"; This program generates exactly the same output as the program we first discussed in this section. However, instead of using the so-called "shortcuts" for the ASCII values, we wrote each character in question using the octal value of that character. Comparing the two programs should provide some insight into the use of octal values in double-quoted strings.
Basically, you simply write `\XYZ', where XYZ is the octal
number of the ASCII character desired. Note that you don't
always need to write all three digits. Namely, notice that the
double-quoted string,
However, note that, in the last string, the three digits are required
for the sequence (
|