foreach $word(@words){ $Counter = $Counter+1; #print("$word\n"); } #### my $count = scalar @words; # style pointer: it is a $count not a $Counter #### # not very useful my $last = $#words; # very useful for(0..$#words) { ... }