- my ($self, $year, $thing, $line) = @_;
- $self->open($year, $thing, ">>") if (!$self->{fh} ||
- $self->{mode} ne ">>" ||
- $year != $self->{year} ||
- $thing != $self->{thing})
- or confess "can't open $self->{fn} $!";
-
- $self->{fh}->print("$line\n");
- return $self;
+ my ($self, $jdate, $line) = @_;
+ if (!$self->{fh} ||
+ $self->{mode} ne ">>" ||
+ $jdate->year != $self->{jdate}->year ||
+ $jdate->thing != $self->{jdate}->thing) {
+ $self->open($jdate, ">>") or confess "can't open $self->{fn} $!";
+ }
+
+ return $self->{fh}->print("$line\n");