in reply to Expanding / flattening a structure

Right off the bat you've got a problem before you even start on your question. Your sub hash period's key 20050824 has duplicate values for the same key (to). That either needs to be an arrayref (to => [ 'new york', 'london' ]), or you need to rethink your data structure some.