#!/usr/bin/perl use strict; my %h = qw/A a B b c c/; my %h2; $h2{$_} = $h{$_} for grep {/^[^a-z]$/} keys %h;