Re: probably a simple question

2002-06-05 Thread Tor Hildrum
Is there any function to tell if a number is even or odd? I am looking for an easy way to loop through a list and output table cell bgcolor based on even / odd. if its an even numbered row make it red if its odd make it blue. I have done it in the past by turning a switch on or off but

Re: probably a simple question

2002-06-05 Thread Sudarsan Raghavan
Zachary Buckholz wrote: Is there any function to tell if a number is even or odd? I am looking for an easy way to loop through a list and output table cell bgcolor based on even / odd. if its an even numbered row make it red if its odd make it blue. $_ % 2 ? print blue\n : print red\n

Re: probably a simple question

2002-06-05 Thread Rajeev Rumale
PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Original Message - From: Sudarsan Raghavan [EMAIL PROTECTED] To: Zachary Buckholz [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Wednesday, June 05, 2002 5:01 PM Subject: Re: probably a simple question Zachary Buckholz wrote

RE: probably a simple question

2002-06-05 Thread Bob Showalter
-Original Message- From: Zachary Buckholz [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 04, 2002 10:11 PM To: [EMAIL PROTECTED] Subject: probably a simple question Is there any function to tell if a number is even or odd? I am looking for an easy way to loop through a list and

Re: probably a simple question

2002-06-05 Thread Bryan R Harris
$_ % 2 ? print blue\n : print red\n foreach (@your_list); This actually works?! Very strange notation, how does the compiler see this line? I assume the mod operator evaluates to 1-true or 0-false, what does the ? do? What does the : do? How do you have a foreach at the end of a line

RE: probably a simple question

2002-06-05 Thread Nikola Janceski
PROTECTED]] Sent: Wednesday, June 05, 2002 1:52 PM To: [EMAIL PROTECTED] Subject: Re: probably a simple question $_ % 2 ? print blue\n : print red\n foreach (@your_list); This actually works?! Very strange notation, how does the compiler see this line? I assume the mod operator

RE: probably a simple question

2002-06-05 Thread David . Wagner
, June 05, 2002 10:52 To: [EMAIL PROTECTED] Subject: Re: probably a simple question $_ % 2 ? print blue\n : print red\n foreach (@your_list); This actually works?! Very strange notation, how does the compiler see this line? I assume the mod operator evaluates to 1-true or 0-false, what does

Re: probably a simple question

2002-06-05 Thread Janek Schleicher
Bryan R Harris wrote at Wed, 05 Jun 2002 19:51:49 +0200: $_ % 2 ? print blue\n : print red\n foreach (@your_list); This actually works?! Very strange notation, how does the compiler see this line? I assume the mod operator evaluates to 1-true or 0-false, what does the ? do? What does

RE: probably a simple question

2002-06-05 Thread Bryan R Harris
: print red\n } -Original Message- From: Bryan R Harris [mailto:[EMAIL PROTECTED]] Sent: Wednesday, June 05, 2002 1:52 PM To: [EMAIL PROTECTED] Subject: Re: probably a simple question $_ % 2 ? print blue\n : print red\n foreach (@your_list); This actually works?! Very strange