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

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.
  • sub partition {
        my ($start, $end, $n) = @_;
        my $s = $start->epoch;
        my $e = $end->epoch;
        my $i = int( ($e - $s) / $n );    # interval
        return map DateTime->from_epoch(epoch => $s + $i * $_), 0 .. $n;
    • What's the point of having classes to handle date arithmetic if you have to convert back into numbers in order to do the math?

      That works, but one shouldn't have to go to those lengths.

      J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers