use strict; use warnings; use POSIX; use CGI qw(:standard); use Calendar::Simple; use DBIx::XHTML_Table; my $today = strftime("%d",localtime); my $caption = strftime("%B %Y",localtime); print header, start_html('simple calendar'); print DBIx::XHTML_Table ->new([calendar],[qw(Su Mo Tu We Th Fr Sa)]) ->modify(table=>{border=>1}) ->modify(caption=>$caption) ->map_cell(\&mark_today) ->output ; print end_html; sub mark_today { my $day = shift; return $day if $day eq ' '; return $day == $today ? u($day) : $day; }