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++;
}
Related examples in the same category