#!/local/bin/perl -w

# An example illustrating the use of arrays.

use strict;

my @colours = ("red", "green", "coral", "pink");
print "The colour array is @colours\n\n";  # Context!

my $size = @colours;
print "The size of the colour array is $size\n";
print "The last index of the colours array is $#colours\n\n";

print "The first colour is $colours[0]\n";
$colours[5] = "blue";
print "Now the size of the colours array is @colours\n\n";


$#colours = 2;  #truncate the array
print "The colour array is @colours\n";

my @copyColours = @colours;  # copy the array
print "The array copyColours holds @copyColours\n";

print "Try indexing beyond last element: $colours[3]\n";



