#!/usr/bin/perl use strict; use warnings; my @array =qw (34 56 78 9); for( my $i = 0; $i <= $#array; $i++ ) { print $i, " ", $array[$i], "\n"; }