in reply to Array to Hash of Hashes

Untested:

my $p= \%hash; my $last= pop @splittedline; foreach @splittedline { $p->{$_}={} if (not exists $p->{$_}); $p= $p->{$_}; } $p->{$last}= 1;

I'm sure someone else will find a more elegant solution ;-). (though I don't consider the obvious solution with eval elegant)