#!/usr/bin/perl -w
use strict;

my (@rainbow) =
   ("red", "orange", "yellow");

for (my $color = 0; $color < @rainbow; $color = $color+1) {
   print_color($color);
}

sub print_color {
   my ($c) = @_;
   print "From $rainbow[$c] to $rainbow[$c+1]...\n";
}
