in reply to Re: Time:Piece help
in thread Time:Piece help

(On a side note, Time::Piece API is bad for it returns T::P object when adding a plain number; returns Time::Seconds object when adding two T::P objects.)

Replies are listed 'Best First'.
Re^3: Time:Piece help
by runrig (Abbot) on Jun 02, 2014 at 23:36 UTC
    On a side note, Time::Piece API is bad for it returns T::P object when adding a plain number; returns Time::Seconds object when adding two T::P objects.

    Adding a number to a T::P object and getting back a T::P object makes sense (the 'number' is assumed to be seconds). What do you expect? The last part of your statement is wrong...you cannot add two T::P objects...that would make no sense, and it is rightfully an error to do so. You can subtract two T::P objects and get back a T::S object, as that makes sense. So what is bad about the API?