Mega Code Archive

 
Categories / Perl / Array
 

Print an element in a list of variables

#!/usr/bin/perl  print "Content-Type: text/html \n\n";  # This script demonstrates how to print an element in an array  @AcmeCars = ("Ford","Dodge","Chevy");  print "<p>* $AcmeCars[0] * is the first element  in the text array.</p>";  print "<p>* $AcmeCars[2] * is the third element  in the text array.</p>";