Basic HTML version of Foils prepared Sept 20 97

Foil 9 Scalar Variables and Comments

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


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 its context and not "type" of variable.
  • $cps616_num is a scalar variable representing number of students in CPS 616
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 may appear 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 Sun Sep 21 1997