Thanks that cleared it up. Talk about a useful operator. Wish I had know
about this 6 months ago. I guess its time to actually read the perl book
rather then using it as a reference manual :) Thanks everyone.

-----Original Message-----
From: Jenda Krynicky [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 08, 2003 11:55 AM
To: [EMAIL PROTECTED]
Subject: RE: Looping with multiples?


From: "Paul Kraus" <[EMAIL PROTECTED]>
> No your not missing anything I am :) I have never seen this before.
> 
> Looking at the perl book it says that it will subtract a$ from the 
> highest multiple of b$ that is not greater then a$.
> 
> So writing a quick loop that does 6 % $i where $i is 1..24 I get these

> results. Which makes sense. But then how could I use this operator to 
> test for 456 , 10 11 12 ect.

You are supposed to use $i % 6, not 6 % $i!

0 % 6 -> 0
1 % 6 -> 1
2 % 6 -> 2
3 % 6 -> 3
4 % 6 -> 4
5 % 6 -> 5
6 % 6 -> 0
7 % 6 -> 1
8 % 6 -> 2
...

So if I understand you right you need to process all items for those 
($i % 6) >=3 (assuming you count from ZERO!!!)

Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to