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" foreach (@your_list);

>
>
> I have done it in the past by turning a switch on or off
> but I think there must be an easier way.
>
> zack
>
> --
> 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