| Christopher Nehren 2004-05-19, 7:30 pm |
|
Convert::TimeUnits provides the Unix units(1) functionality to Perl,
converting between various different units of time. I was inspired to
write this because Windows and apparently many Unix (*cough* Linux)
systems don't come with such a program by default, and I really didn't
want to use `` or qx. Right now it has a functional interface for simple
units(1) conversions, and an object-oriented interface for fancy
gunits(1) style conversions of more than one unit into the desired unit.
Accessors are provided.
Because of their inconsistent lengths, months are not included.
Calculating months properly would make the code really ugly, too.
Near future plans: implement a pretty-calculate function that will take
either a reference to a hash of unit values or a Convert::TimeUnits
object (oh how I love Perl's OOP system), and then calculate the total
amount of time expressed by those values and return that derived set of
values as a hash reference or Convert::TimeUnits object.
--
I abhor a system designed for the "user", if that word is a coded
pejorative meaning "stupid and unsophisticated". -- Ken Thompson
-
Unix is user friendly. However, it isn't idiot friendly.
-
Please CC me in all replies, even if I'm on the relevant list(s).
|