in reply to Split date ranges/chunks based on Unix epoch time?

Looks fine to me, though I don't know why you got DateTime involved to do what localtime does.

my @times = ...; my %date_count; foreach my $time (@times) { my ($y,$m,$d,$h) = (localtime($time))[5,4,3,2]; $date_count{$y+1900}{$m+1}{$d}{$h}++; } ...

I suppose you could use a flatter structure, but it's doesn't leave the data in a format as useful as yours.

use Time::Local qw( timelocal ); my @times = ...; my %date_count; foreach my $time (@times) { my ($y,$m,$d,$h) = (localtime($time))[5,4,3,2]; $date_count{timelocal(0,0,0,$d,$m,$y)}++; } ...