my %h = ( 'a1' => 1, '001' => 1, '993' => 1, 'd' => 1, 'i' => 1) ; my $arr_ref = [(grep ( /[[:alpha:]]/, (keys(%h)) ))] ;