in reply to finding multiples of two values

I see you're confused, but what is your question? How to write a subroutine? See perlintro, perlsub. How to determine multiples?