I'm really new to programming
LOL! Ah, memories. When it was new and exciting.
So -- How new?
Let's walk through hippo's stuff and add a few bread crumbs for flavor.
- Loop over each value in array1
Do you know how to do this? Hint: foreach
- For each of these loop over each value in array2
Okay, if you can answer the previous one, this one's a gimme, right?
- Inside the two nested loops you can compare every possible pair of values. See if the value from array1 is divisible by the value from array2
Ah, now you're going to have to actually make Perl do math for you.
On second thought, I'll keep this breadcrumb to myself for the moment. Let's see how your code shapes up with the first two points.
After all, posting your code is a great way to get help. Even if it doesn't work.
Check that. Especially if it doesn't work. Because that means at least you tried, and we're very likely to see how your thought processes are approaching the issue. Lots to work with that way.