my @loop; #fill in the array @loop with hash references from @allow_edit... foreach (@allow_edit){ my($name, $value) = split /=/,$_; push @loop, {part1=>$name, part2=>$value}; }