Scalars
homencsa resources partnershipsoutreachsoftware_tech
alliance searchinside ncsa adv_computingsciencedivisions
left up right comment

Scalars

Scalars are accessed by prefixing an identifier with '$'.
scalar:
A single value, either numeric or a character string.
identifier:
A "variable name." It is composed of upper or lower case letters, numbers, and the underscore '_'. Identifiers are case sensitive (like all of perl).
Scalars are assigned to using '='
 
	$scalar = expression; 

Example

 
        ... 
        ################################################################ 
        # Configuration parameters 
        ################################################################ 
        # this program's name 
        $progname = "mailform"; 
This is read as "the scalar progname is assigned the string mailform".
  1. The '$' determines that progname is a scalar.
  2. the '=' determines that this an assignment.
  3. The double quotes (") define the string.
  4. All statements end with a semi-colon ';'.

left up right comment



NCSA
The National Center for Supercomputing Applications

University of Illinois at Urbana-Champaign

johnsonb@ncsa.uiuc.edu

Last modified: June 19, 1997



Retrieved by Memoweb from http://www.ncsa.uiuc.edu/General/Training/PerlIntro/scalars.html at 08/02/99