Skip to Content.
Sympa Menu

devel - [sympa-developpers] CPAN alternatives for time-related functions

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: Guillaume Rousse <address@concealed>
  • To: address@concealed
  • Subject: [sympa-developpers] CPAN alternatives for time-related functions
  • Date: Mon, 24 Mar 2014 15:30:57 +0100

The Sympa::Tools::Time module contains a few time-related functions, mostly related to conversion between string and timestamps formats:
epoch2yyyymmjj_hhmms()
adate()
get_midnight_time()
epoch_conv()
date_conv()
duration_conv()
parse_date()

Those 300 lines of code would easily be replaced by some perl module available from CPAN. Here is a list of potential alternatives:

1) Date::Parse: no dependencies, pure perl, but limited to date string conversions (it would not replace duration_conv(), for instance).

2) Date::Manip: few dependencies, pure perl, no idea about the exact coverage

3) DateTime framework (DateTime, DateTime::Format::Mail, etc...): multiple dependencies, native code, but covers practically everything.

They could be potentially others, but I limited myself to the one known to be actively maintained nowadays.

That's basically a choice between a lightweight-but-limited vs heavywheight-but-complete external dependency. I'd personaly go for DateTime framework, which is basically in line with the "let's get rid of old environement constraints", but that's a merely a project management decision.
--
Guillaume Rousse
INRIA, Direction des systèmes d'information
Domaine de Voluceau
Rocquencourt - BP 105
78153 Le Chesnay
Tel: 01 39 63 58 31

Attachment: smime.p7s
Description: Signature cryptographique S/MIME




Archive powered by MHonArc 2.6.19+.

Top of Page