我需要以垂直格式显示日历;我怎样才能得到这种格式?我尝试了一些示例 perl 脚本。
脚本:
use strict;
use Calendar::Simple;
my @months = qw(January February March April May June July August
September October November December);
my $mon = shift;
my $yr = shift;
my @month = calendar($mon, $yr);
print "\n$months[$mon -1] $yr\n\n";
print "Su Mo Tu We Th Fr Sa\n";
foreach (@month) {
print map { $_ ? sprintf "%2d ", $_ : ' ' } @$_;
print "\n";
}
它可以像普通日历一样执行,也可以横向格式执行;怎么改成竖排格式...
需要输出为:
sun 1 5 6
mon 2 3
wed ...
thu ...
fri ...
stu ...
我如何做到这一点......