In DateTime::Duration:

  sub new():
    ...
    unless ( grep { $self->{$_} } qw( months days ...
    {
      $self->{sign} = 0;
    }


and then:

  sub is_positive { $_[0]->{sign} == 1 ? 1 : 0 }

which makes a zero-duration be "not positive",
because sign is zero.

- Flavio S. Glock


Reply via email to