my %hash = ( 'company' => { 'microsoft' => {'applications' => {'windows' => 'operating system', 'office' => 'office suite'} ,'people' => {'bill gates' => 'chair man'} }, 'sun microsystems' => {'applications' => {'solaris' => 'operating system', 'star office' => 'office suite'} }, 'cross over' => {} } ); #### add_to_hash(\%hash,'scalar','companies-microsoft-people-steve ballmer','bills bulldog') #and you suddenly decide to have another category add_to_hash(\%hash,'list','companies-cross over-supports','iTunes','photo shop') #or something more elegant