Arrays

Array content: examples

Only numbers:

@msr = (3, 2, 5, 9, 7, 13, 16);

Successive numbers:

@num =  (3 .. 7);   #same as @num = (3, 4, 5, 6, 7);
@num1 = (3 .. 7, 9);#same as @num1 = (3, 4, 5, 6, 7, 9);

Only strings:

@subjects = ("biology", "chemistry", "math");

Strings and numbers:

@mixed = (3, 0.5, "Israel", "Canada", 2.7e-15, "China");

Values and variables:

@k = ($a, $b, 5, $c, "Mona");
       # assuming $a, $b, $c contain some scalar values

An empty list:

@list = ();


Table of Contents.
Next.