Arrays
# Scalar assignment:
$pi = 3.141;
# Array assignment:
@pies = ($pi, "22/7", "apple pi");
# Uses of an array:
$r = 2;
$area = $pies[0] * $r * $r;
print 'The @pies array ', "is @pies.\n";
The @pies array is 3.141 22/7 apple pi.
Previous slide
Next slide
Back to first slide
View graphic version