#!/usr/bin/perl

{
package Disp::Cal;

my $VERSION = "0.01";

sub new {
my $self = shift;
my @t = localtime;
bless {"YEAR" => ($t[5] + 1900),
"MONTH" => ++$t[4]}, $self;
}
sub setYear {
my $self = shift;
my $year = abs(int(shift));
if($year < 1970 or $year > 2037){ die "bad year" }
$self{"YEAR"} = $year;
}
sub setMonth {
my $self = shift;
my $month = abs(int(shift));
if($month < 1 or $month > 12){ die "bad month" }
$self{"MONTH"} = $month;
}
sub output {
my $self = shift;
my $handle = shift;
syswrite($handle, `cal $self{MONTH} $self{YEAR}`);
}
}