UPDATE: added check for ' ' to prevent warnings (thanks for testing, hacker)
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; }
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|