eWebProgrammer
Distributednetworks GofPatterns
prev next prev next
  Course navigation
 
Lesson 2
Objective
Scalars in Perl
Familiarize yourself with the basic use of the scalar type.
   
The scalar type is the basic building block of all Perl data types. It is used to store all one-dimensional data. In fact, the multi-dimensional data types that we will learn about later are built from scalar data.
Scalar data can be either
  1. numeric or
  2. textual.
Here are some examples of scalar variables:
$name = "Bill";  # a string 
$age  = 842;     # a number
All scalar values exists in some memory space, even if it doesn't have a name. In fact, the only difference between a scalar variable and any other scalar value is that the variable has a name associated with it.
  Course navigation