Class 2.

Topics

Data types.

Uses: scalars store single numbers or strings.

An array is an ordered list of scalars.

Hashes are an unordered set of key/value pairs, indexed by the keys which are paired with scalar values. Useful for quick lookup in large lists.

How these data types are denoted:

There is a special global scalar and a special array in Perl. The special scalar is denoted by $_ and the array by @_. Many functions, if not given an argument, will assume one of these special variables as an argument. Typically $_ contains the current line being read from an input file.





Richard Waterman
Fri Jan 22 01:27:29 EST 1999