#!/usr/bin/perl @tasks = qw(plan simulation analysis); $i=0; foreach $task(@tasks) { print "Task $i: $task\n"; $i++; } # prints the following: # Task 0: plan # Task 1: simulation # Task 2: analysis