#!/usr/bin/perl -w use strict; use Data::Dumper; ## version 1.... my $num =0; my %h = map{$_, $num++}('A'..'Z','a'..'z'); print Dumper \%h; ## version 2... my %hash; foreach my $letter (('A'..'Z','a'..'z')) { $hash{$letter}++; } print Dumper \%hash; foreach (sort keys %h) { print "$_ OK\n" if $hash{$_}; }