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.

  1. Loop over each value in array1
    Do you know how to do this? Hint: foreach
     
  2. For each of these loop over each value in array2
    Okay, if you can answer the previous one, this one's a gimme, right?
     
  3. 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.

In reply to Re: Comparing two arrays by marinersk
in thread Comparing two arrays by gilthoniel

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.