You really have just one key value pair. The other items you want (all groups and all dogs) are arrays, they have no real relation to one another except their group. The dog/food pairing, however, is very specific.
Perl provides a way to access these arrays, were you to place the dog/food pairing in a hash. See
keys and
values. That should take care of your data structuring issue (if I am understanding you correctly).
For the regular expressions I point you to
perlre. If you look through this first then maybe we can get down to some of the specifics for getting that data into a hash. If you've already read it, great! Do you have any cases you've tried or any ideas to go on?
HTH!