@@ -54,7 +54,9 @@ sub newer_than {
5454 my $self = shift ;
5555 my $date = shift ;
5656 return if !defined ($date );
57- my $offset = shift ;
57+ my $offset = shift ;
58+ local *STDERR ;
59+ open ( STDERR , ' >>' , ' /dev/null' );
5860 my $now = dclone( $self -> _now_ );
5961 my $duration = DateTime::Duration-> new( days => $offset );
6062 my $old_date = $now -> subtract_duration($duration );
@@ -65,8 +67,11 @@ sub older_than {
6567 my $self = shift ;
6668 my $date = shift ;
6769 return if !defined ($date );
68- my $offset = shift ;
69- my $now = dclone( $self -> _now_ );
70+ my $offset = shift ;
71+ open ( my $STDOLD , ' >&' , STDERR );
72+ open ( STDERR , ' >>' , ' /dev/null' );
73+ my $now = dclone( $self -> _now_ );
74+ open ( STDOUT , ' >&' , $STDOLD );
7075 my $duration = DateTime::Duration-> new( days => $offset );
7176 my $old_date = $now -> subtract_duration($duration );
7277 return $date -> subtract_datetime($old_date )-> is_negative;
@@ -90,7 +95,10 @@ sub offset2date {
9095 my $self = shift ;
9196 my $offset = shift ;
9297 my $duration = DateTime::Duration-> new( days => $offset );
93- my $now = dclone( $self -> _now_ );
98+ open ( my $STDOLD , ' >&' , STDERR );
99+ open ( STDERR , ' >>' , ' /dev/null' );
100+ my $now = dclone( $self -> _now_ );
101+ open ( STDOUT , ' >&' , $STDOLD );
94102 return $now -> subtract_duration($duration );
95103}
96104
0 commit comments