#!/bin/perl

# This example demonstrates the use
# of an ARRAY data type...


#####################################
# FIRST PART
#####################################
@characters = ("Kino","Juana", 'Coyotito'); 

#####################################
# SECOND PART
# Print the entire array of characters 
#####################################
print "print the entire array \n";
print @characters;
print "\n";

#####################################
# THIRD PART
# Print the characters with a for loop 
#####################################
print "print entire array with a for loop \n";
for ($i=0; $i<=2; $i++)
    { 
       print "$characters[$i] \n";
    }
print "\n";

#####################################
# FOURTH PART
# Print the characters with a for loop 
# using without hardcoding the array size 
#####################################
print "print entire array backwards with for loop \n";
print " without hardcoding the array size \n";
for ($i=$#characters; $i>=0; $i--)
    { 
       print "$characters[$i] \n";
    }
print "\n";

#####################################
# FIFTH PART
# Print the characters with a foreach loop 
#####################################
print "print the characters with a foreach loop \n";
foreach $person (@characters)
    { 
       print "$person \n";
    }
print "\n";


#####################################
# SIXTH PART
# Print 2nd element 
# of the character array 
#####################################
print "print the 2nd element of character array\n";
print "$characters[1] \n";
print "\n";


