On 12/18/2003 7:00 PM, James Edward Gray II wrote:
On Dec 18, 2003, at 5:48 PM, Mike Blezien wrote:

Hello,

been trying to come up with a way, while going through a loop to alternate a table cell color <td></td>....


See if this gets you thinking along the right lines:

my $odd = 1;
while (<>) {    # some kind of loop...
    if ($odd) {
        # do something
        $odd = 0;
    }
    else {
        # do something else
        $odd = 1;
    }
}


or


my $alt;
while (<>) {    # some kind of loop...
    if ($alt = !$alt) {
        # do something
    }
    else {
        # do something else
    }
}


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to