Basic HTML version of Foils prepared Sept 20 97

Foil 8 Scalar Data III --
Double-Quoted Strings

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


Double-quoted strings are very similar to C with many special characters given in table 2-1 of Llama book and online PERL man page. (See later in foils)
  • Examples: \n is newline, \t is tab and \cC is Control-C
  • Example: 'Hello
    • World' is equivalent to "Hello\nWorld"
  • Note \L instructs PERL that all following characters until a \E are to be interpreted as lower case
  • \U ... \E is similar but intervening characters are upper case
A critical feature of double-quoted strings is that they "interpolate" variables (e.g., with $ as initial character). For this reason use \$ to denote a literal dollar sign in a double-quoted string.
Variables are NEVER interpolated in single-quoted strings



© 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