Global symbol "$key" requires explicit package name (did you forget to declare "my $key"?) at - line 11. Global symbol "$value" requires explicit package name (did you forget to declare "my $value"?) at - line 11. Global symbol "$key" requires explicit package name (did you forget to declare "my $key"?) at - line 12. Global symbol "$value" requires explicit package name (did you forget to declare "my $value"?) at - line 12. Execution of - aborted due to compilation errors. #### #! /usr/bin/perl use v5.12; use warnings; ## 2/15/19 my @people = qw{ fred barney fred wlima dino barney fred pebbles }; my %count; # new empty hash $count{$_}++ foreach @people; while ( my ($key, $value) = each %count) { print "$key => $value\n"; } __END__ __OUTPUT__ wlima => 1 barney => 2 dino => 1 fred => 3 pebbles => 1