#!/usr/bin/perl -w use strict; use Calendar::Simple qw(calendar); use POSIX qw(strftime); my $today = strftime '%Y-%m-%d', localtime; my ($year, $month) = split /-/, shift || $today; printf "\n%04d-%02d\n\n", $year, $month; print "Mon Tue Wed Thu Fri Sat Sun\n"; for (calendar $month, $year, 1) { for (@$_) { no warnings; $_ = sprintf '%3s', $_ || ''; } print "@$_\n"; } print "\n";