Hi, new to the list here; quick question !

How do I nest multiple arrays in one 'foreach' statement ?

ex.

@animals = ("cat",
"dog",
"ferret",
"mouse"
);

@petfood = ("meow mix",
"dog chow",
"ferret food",
"mouse food"
);

foreach $object (@animals) {
  print "animal = $object and food = @petfood";
  }

The results I am lookg for are

animal = cat and food = meow mix
animal = dog and food = dog chow
animal = ferret and food = ferret food
animal = mouse and food = mouse food

Thanks alot for you help

Is there a better way of doing this also ?

**DAN**

Reply via email to