Home » Perl Basics
3

Variables

A variable is a place to store a value, so it can be referred to or altered throughout your program.
Perl has 3 types of variables. The three types of variables are: scalar, array, and hash which will be discussed further in this section.

In This Chapter:

Scalars
Scalar variable stores single value
Arrays
Array variable is a list of scalars
Hashes
Hash is defined with a key/value relationship
Using Blocks
Learn how to manage hundreds of line by using blocks.
Input from Keyboard
Variables can also take their value from user inputs as the script is running
Working with Arrays
Understanding arrays and their basic functions