Basic HTML version of Foils prepared Sept 20 97

Foil 7 Scalar Data II --
Single-Quoted Strings

From Tutorial on PERL Computational Science for Information Age Course CPS616 -- Sept 20 97. by Geoffrey C. Fox,Nancy McCracken,Tom Scavo


1 There are two types of strings defined by a stream of characters surrounded by either single quotes ' or double quotes "
2 Single-quoted strings are perhaps the simplest
3 Inside such strings ALL characters including newlines are treated literally except that ' must be represented as \' and \ as \\
  • In particular, \n does NOT represent a newline
  • Example: 'don\'t' is the five character word don't
4 As in C, ALL strings are stored as zero-byte terminated byte streams so that
  • '' and "" are both stored internally as one byte 00 (octal zero)

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Sep 21 1997