#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11147614 use warnings; my @myArray = qw(alfa beta gamma); warn "at position $_ there is $myArray[$_]\n" for 0 .. $#myArray;