my @questions = [ { page => 'p1', idstr => '4B', label => "... ice cream?", answertype => 'single', answerset => { 1 => 'yes', 2 => 'no' } } ... ]; # or ... my %questions = { '4B' => { page => 'p1', label => '... ice cream?', ... } '4C' => { page => 'p1', label => '... whipped cream?', ... } ... };