while (defined $dates[0]) { my $days = $dates[0]; my ($year, $month, $day) = Add_Delta_Days(1,1,1, $days - 1); my $new_c = "new HTML::CalendarMonth ( year => $year, month => $month),"; push (@cals, $new_c); @dates = CreateCal($year, $month, @dates); } #### # Embolden headers foreach (@cals) { $_->item($_->month,$_->year)->wrap_content(font({size => '2'})); $_->item($_->dayheaders)->wrap_content(font({size => '1'})); $_->item(15,16,17)->wrap_content(font({size => 4, color => 'red'})); } # Generate container table my $t = new HTML::ElementTable ( maxrow => 1, maxcol => 4 ); # Populate container table foreach (0..$#cals) { $t->cell(0,$_)->push_content($cals[$_]); } print $t->as_HTML; exit; sub CreateCal { my ($cyear, $cmonth, @dates) = @_; my (@days, @temp); foreach my $days (@dates) { my ($year, $month, $day) = Add_Delta_Days(1,1,1, $days - 1); if ($year == $cyear && $month == $cmonth) { push (@days, $day); } else { push (@temp, $days); } } return @temp; }