Dave Rolsky wrote:
> 
> On Fri, 3 Oct 2003, Eugene van der Pijll wrote:
> 
> > >  $dt1->subtract_datetime( $dt2 ); # current behavior
> > >
> > >  $dt1->subtract_datetime( datetime => $dt2,
> > >                           units => [ qw( days minutes nanoseconds ) ] );
> >
> > I didn't really like my API either, but a function with two different
> > API's isn't very nice either. I can live with both, though, if there is
> > no better solution.
> 
> The alternative is to create a new method, something like
> "subtract_datetime_my_units", but with a better name than that.

How about:

  $dur = $dt1->difference( datetime => $dt2,
                           units => [ qw( days minutes nanoseconds ) ]
);

Is it possible to add 'years' to the list?

- Flavio S. Glock

Reply via email to