#!/usr/bin/perl -w use v5.10.1; my @array = qw/one two three/; while (my ( $index, $line ) = each @array) { print "$index: $line\n"; } Result: Type of arg 1 to each must be hash (not private array) at ./t8 line 7, near "@array) " Execution of ./t8 aborted due to compilation errors.