For Programmers: Free Programming Magazines  


Home > Archive > PERL Modules > May 2004 > New module proposal: Convert::TimeUnits









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author New module proposal: Convert::TimeUnits
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).

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com