my @array = split '', $string; @hash{@array} = map {ord} @array;