next up previous contents
Next: String Scalar Variables Up: Scalar Variables Previous: Scalar Variables

Defining Scalar Variables

You define scalar variables by assigning a value (number or string) to it.

The following are simple examples (var1.pl) of variable declarations:

$first_name = "David";
$last_name = "Marshall";

$number = 3;

$another_number = 1.25;

$sci_number = 7.25e25;

$octal_number = 0377; # same as 255 decimal

$hex_number = 0xff; # same as 255 decimal

NOTE:



dave@cs.cf.ac.uk