my %hash; my @array = qw( ABC DEF GHI ); for my $key (@array) { $hash{$key}++ }