8. Example 8

#!/usr/bin/perl
#program name: example8.pl
#demonstration of arrays
@pets= ("dog", "cat", "parrot", "hamster" );
print ("my pets are:\n");
print ("$pets[0]\n");
print ("$pets[1]\n");
print ("$pets[2]\n");
print ("$pets[3]\n");