Basic HTML version of Foils prepared March 30 97

Foil 7 Scalar Variables and Statements/Comments (Chapter 2 of Llama Book)

From PERL4 Tutorial for CPS616 Computational Science for Information Age Course CPS616 -- February 1995. by Geoffrey C. Fox


Scalar Variables are named variables holding numeric or string scalars or both. There are NO types (integer float char) of variables. The interpretation of a scalar is always determined by context and not "type" of variable.
  • $cps616_num is a scalar variable represting number of students in CPS616
Variables are set by conventional equal sign
  • $cps616_num = 15;
Note statements are ended by semicolons -- not by newlines and # can be used to denote a comment
  • $Instructor= "Fox"; # Not really true as Wojtek did all the work
Comments can be single lines or after statements or on a line on their own. They are terminated by newlines.



© 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 Sat Sep 6 1997