Module of the Day

jplindstrom on 2002-10-07T16:09:56

Today's catch on CPAN: Time::Duration I needed to print out human-friendly "seconds left until completion" (i.e. "1 hour and 5 minutes") and figured someone else had done that already. It took me no more than two minutes to find, install and use the module. http://search.cpan.org/author/SBURKE/Time-Duration-1.01/Duration.pm CPAN remains _the_ best example of software reuse that I've ever encountered, all categories (and that's considering that my final paper at university was titled "Organizational aspects of software reuse").

/J


Time::Duration

TorgoX on 2002-10-08T07:42:31

Glad you liked it! When I was writing Time::Duration, the most surprising thing was that I couldn't find anything quite like it anywhere. When I tried writing the internal logic, I found out why -- it was surprisingly hard. That makes me think that endless numbers of people start to write it, realize it's ten times harder than they thought, and give up.

Look for Time::Duration 1.02 in CPAN probably by time you read this. By popular request, I added a new function, concise(). Where ago($thing) might return "53 minutes and 4 seconds ago", concise(ago($thing)) will return "53m4s ago".