in reply to read flat file and build tree-like structure

Parsing is simply using split twice. Data::Diver provides an easy means of storing the data in the appropriate place in the hash.
use Data::Diver qw( DiveVal ); my %hash; while (<>) { chomp; my ($key, $val) = split(/=/, $_, 2); my @keys = split(/\./, $key); DiveVal(\%hash, map \$_, @keys) = $val; }