Calendar::Simpleと Text::ASCIITableを使って書いてみた。。
プログラム
#!/usr/bin/env perl use strict; use warnings; use Calendar::Simple; use Text::ASCIITable; my ($this_mon, $this_year) = (localtime)[4,5]; my $month = shift || ($this_mon + 1); my $year = shift || ($this_year + 1900); my @month = calendar($month, $year); my $t = Text::ASCIITable->new({ headingText => "$year/$month", }); $t->setCols(qw/Sun Mon Tue Wed Thr Fri Sat/); for my $m (@month) { $t->addRow(@{$m}); $t->addRowLine(); } print $t;