Mega Code Archive

 
Categories / Perl / Array
 

A program that prints the elements of a list

#!/usr/local/bin/perl  @array = (1, "chicken", 1.23, "\"Having fun?\"", 9.33e+23);  $count = 1;  while ($count <= 5) {      print ("element $count is $array[$count-1]\n");      $count++;  }