in reply to Re: Final Solution for Generating a container table in HTML::CalendarMonth?
in thread Generating a container table in HTML::CalendarMonth

% or modulus division is very simple.
my $col = $calnum % 3;
Divide $calnum by 3 and store the remainder in $col.

1 % 3 = 1
2 % 3 = 2
3 % 3 = 0
4 % 3 = 1
...

Replies are listed 'Best First'.
Re: Short Explaination of %
by jonnyfolk (Vicar) on Apr 01, 2003 at 15:19 UTC
    Of course, I see - the remainder always gives the column number. Devious. Brilliant.
    jonnyfolk walks away shaking his head in admiration...