Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

miyagawa (1653)

  (email not shown publicly)
AOL IM: bulknews (Add Buddy, Send Message)

Journal of miyagawa (1653)

Monday July 17, 2006
03:31 AM


[ #30310 ]


do you know if there's a module to parse human readable duration format into seconds, like:

    is( parse_duration("3 seconds"), 3 );
    is( parse_duration("7 days, 5 hours"), 622800 );

I want to allow users of Plagger to write things like:

    fresh: 7 days

in YAML config file, to say "I want fresher entries than 7 days old".

So it's kind of opposite to what Time::Duration does. I know there's DateTime::Format::Duration but it looks like you have to explicitly specify which format you expect and that's not what I want.

Cache::BaseCache module has internally a similar code that I want. Do you think it's worth splitting the functionality to a separate module?

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.