+# $s = 'foo.bar.baz.spam.eggs.ham'; $h = \%h; $h = $h->{$_} = {} for split /\./, $s; \%h
+# ==> {foo => {bar => {baz => {spam => {eggs => {ham => {}}}}}}}
+sub insert_string_deep {
+ my ($h, $ks, $v) = @_;
+ my $p = \$h; $p = \$$p->{$_} for split /\./, $ks;
+ $$p = $v;
+}
+
+# sub insert_string_deep
+# {
+# my ($hash, $key, $value) = @_;
+#
+# my @key = split /\./, $key;
+# my $h = $hash;
+#
+# my $i = 0;
+# for my $k (@key) {
+# $i ++;
+# if ($i == @key) {
+# $h->{$k} = $value;
+# } else {
+# if (ref $h->{$k}) {
+# $h = $h->{$k};
+# } else {
+# $h = $h->{$k} = {};
+# }
+# }
+# }
+# }
+