#!/usr/local/bin/perl use strict; use warnings; my @colors = qw(red green blue orange pink); foreach my $i (0..$#colors) { print "$i: $colors[$i]\n"; } for (my $i = 0; $i < $#colors; $i++) { print "$i : $colors[$i]\n"; }